Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    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. alickn

    alickn

    Joined:
    Mar 23, 2018
    Posts:
    7
    Hi Jackson, I feel your frustration. However, ask Unlogick to send you a version before this one, i.e version 1.3.1, it works perfectly while you wait for the current bug in version 1.4 to be fixed. I experienced the same problem. I had to revert to the previous version.
     
  2. UnLogick

    UnLogick

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

    Updated the dlls!
    No other changes than making the dlls work again.
     
    Ascensi likes this.
  3. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Thanks for keeping up the development! By any chance have you been able to capture the textures from tri-planar in this update?
     
  4. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    No, unfortunately I've been completely swamped. This is merely fixing the massive glitch that was 1.4.0 :)

    But I got 1.4.1 released and I found time both yesterday and today for looking at my packages, so things are definitely getting better.
     
    Ascensi likes this.
  5. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    is support export light and camera to fbx?
     
  6. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    No, it is on my roadmap but I can't offer any hint to when I'll find time for it. I did some primitive tests that indicated it wasn't as trivial as I had hoped. Adding a light and a camera was easy enough, but the camera refused to point in the right direction and mapping the light settings from unity to max/maya was also a bit off.
     
  7. SandiagoChan

    SandiagoChan

    Joined:
    Aug 8, 2017
    Posts:
    16
    I want to know whether it can be executed in exe?
    In other words,does this tool reference to UnityEditor?
     
  8. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    Yes it works in windows standalone target, all you have to do is tell Unity to include the appropriate dll (32 bit or 64 bit) into the build. It is excluded by default to avoid bloating build size for the majority who doesn't need this.
     
  9. SandiagoChan

    SandiagoChan

    Joined:
    Aug 8, 2017
    Posts:
    16
    What I mean is does this tool can only work in EditorMode and does not work when the project builted as exe?
     
  10. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    It works in exe mode on windows 32 bit and windows 64 bit
     
  11. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi, before purchasing this plugin, does this plugin also export normal maps and secondary maps if any? I'm primarily exporting it for use in another Unity project so I also need the texture settings of the materials to be exported too.

    Edit: Hi I've already purchased the plugin but I've noticed that it does not copy material settings e.g. color/transparency/renderingmode/shader type. Does the plugin do material export of any of those settings?

    Thanks.
     
    Last edited: Jul 10, 2018
  12. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    Hi @Ibukii

    Settings such as shader type is not supported by unity's fbx importer, as such I could write them into the fbx but they would be ignored. When it comes to color and transparency I do believe I write those, so that it may work in certain 3rd party tools, but Unity doesn't respect that. In theory I could add this as custom fbx properties and write a fbx import post processor to set it up, however I'm reluctant to do that fearing it might interfere with several customers own custom importers.

    You did inspire me for a new feature: I could export into the current project set up the material and then copy the fbx (and the meta file) to the requested location. If you then copy the fbx and the material asset into your other project all import settings would be correctly configured.

    Regards,
    Joen - UnLogick
     
  13. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi Unlogick,

    That actually sounds great! Can I check if that is in your road map?
    I'm asking because this feature is quite important.

    Thank you so much for the reply.
     
  14. lucasfrancops

    lucasfrancops

    Joined:
    Jul 26, 2018
    Posts:
    2
    Hi @UnLogick

    Let's say for instance I wanna export a Game Object that has a child with a Skinned Mesh Renderer component attached to it, manipulate it somewhere else and then bring it back to Unity. Will my Game Object remain the same as when I exported it? Same structure, same children, same components (to the children as well), etc.

    The problem I'm having with other exporters is that I export this Game Object with a Skinned Mesh Renderer attached to one of its children and when I import it back again, its children doesn't have a Skinned Mesh Renderer anymore, instead they are imported with a Mesh Renderer.

    EDIT
    Forgot to ask you one more thing: is it editor only? I need something that works runtime on a standalone build.
     
  15. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    It will be as close to the same structure as the fbx format and the unity fbx importer allows. Any exporter that transforms a skinned mesh to a mesh renderer doesn't export the skinned mesh correctly. This exporter supports skinned meshes.

    And it works on windows 32 bit and 64 bit standalone as well as in the editor, you just have to make the appropriate dll part of the build. This is done by selecting the appropriate dll (64 bit or 32 bit) inside unity and activating it for the build target.
     
  16. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    119
    @UnLogick : Hi, your asset is working great for exporting FBX file on Windows !

    We have a workflow where Blender is involved. When exporting FBX files from 3DS Max with a custom property set by the user, the FBX is imported in Blender and the property is properly displayed and available in Blender.
    When we export a FBX from Unity with your asset, setting the same custom property, nothing is displayed in Blender (and no property is available from Python in Blender).

    I traced the source of the problem:
    - in 3DSMax, the custom property is set like this in the FBX:
    Model: 4345480704, "Model::Line006_SM", "Mesh" {
    Version: 232
    Properties70: {
    [...]
    P: "UDP3DSMAX", "KString", "", "U", "blablabla1=foobarfoobar;blablabla2=foobar2;"
    [...]
    }
    Shading: T
    Culling: "CullingOff"
    }


    The UDP3DSMAX property is specifically set by 3DSMax : https://knowledge.autodesk.com/supp...21B34883-49AC-46BF-80A6-38D26AFC6C19-htm.html
    When you look inside 'import_fbx.py' from the Blender 'Import FBX' plugin, you can see that they handle it like that :

    for fbx_prop in fbx_obj_props.elems:
    assert(fbx_prop.id == b'P')
    if b'U' in fbx_prop.props[3]:
    if fbx_prop.props[0] == b'[B]UDP3DSMAX[/B]':
    # Special case for 3DS Max user properties:
    assert(fbx_prop.props[1] == b'KString')
    assert(fbx_prop.props_type[4] == data_types.STRING)
    items = fbx_prop.props[4].decode('utf-8', 'replace')
    for item in items.split('\r\n'):
    if item:
    prop_name, prop_value = item.split('=', 1)
    blen_obj[prop_name.strip()] = prop_value.strip()
    (...)

    That means that even if we call our custom property in C# code with UDP3DSMAX, it's not going to work, because the fourth element of the line most be set to "U".

    To deal with that, for the moment I edit the .py importer from Blender, to add our custom string, but it's not very convenient. Is it possible for you to add that kind of modification to your code ?
    That would let us pass a custom property as something define by 3DSMax, and let Blender happily import it without modding it !
     
  17. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    Hi Pode

    Thanks for providing so much information, I'm still unsure how the property shows up with my exporter. But it sounds like you've checked it and everything else is fine.

    You're probably right that the problem is that "U" in the third element and I'll try to look into how to add that. The only thing that the sdk shows that I'm not setting is the label, so I can try setting the label to "U" for utf-8.

    Another alternative is that each mesh has both an "fbxnode and an "fbxmesh", so it could also be that you should try to add the property to the transform rather than the mesh itself though that's a stretch. (which you probably already checked)

    Could you pm me your email address so I can try to send you a modified dll for testing? No reason in me making a chromed solution if that doesn't work for you. :)

    Regards,
    Joen - UnLogick
     
  18. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @UnLogick Hi there any progress on being able to export Megasplat/Voxeland/ Triplanar textures? (world space textures) Last time I asked about this was around May, I'm hoping there will be something available soon. If support for this is able to be made I am 150% certain you will gain many customers whom use these assets that will be able to create HQ film from their terrain models in 3rd party animation programs and to be able to sell the models as well.
     
  19. moepmoep12

    moepmoep12

    Joined:
    Aug 8, 2018
    Posts:
    2
    Hi there,

    I'm using your plugin to export an entire scene as fbx ( technically only the root object) . My application is a level editor. Unfortunately the textures won't show up. I've tried viewing the fbx with the 3D-Viewer Windows App, Paint 3D, Blender and another plain Unity project. Paint3D will load the textures correctly if I import the folder of all used textures.

    My materials are all very basic, using the standard shader. Mostly only using diffuse maps.

    I've tried exporting a simple cube with a simple material and texture. Doesn't work.

    I've tried exporting from Editor & from code at runtime.

    The materials on the objects are exported correctly ( amount, name ) but they're all missing their diffuse texture
     
    Last edited: Dec 14, 2018
  20. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    That's odd.

    1. Please confirm that there is a texture folder with diffuse, specular and normal textures (and that the textures seems valid).
    2. Did you open the fbx file on the saved location or did you move it manually (copy/paste, email, etc.) if you move it manually make sure to copy the texture folder along with the fbx file. The textures are referenced relative to the fbx file, so the texture folder must be right next to the fbx file. If you want another functionality it should be trivial to go in and hack the code to alter this.
    3. Which texture export options did you choose?
    4. What version of Unity are you using
     
  21. moepmoep12

    moepmoep12

    Joined:
    Aug 8, 2018
    Posts:
    2
    1. The textures are all within the texture folder. They seem ok.
    2. I didn't move them.
    3. "Export all", "Scale Full", "Gamma"
    4. 2018.2.0f2

    When exporting the fbx into another Untiy project I can extract the materials and they have the proper name. However, I'm not able to extract the textures.

    It seems like the references are somehow not working.


    It works properly though when importing the textures seperately. However, I'm having trouble to export the scaling of the texture. In the level editor materials can be scaled via SetTextureSale(). I was hoping the exported texture would be scaled as well.
     
    Last edited: Dec 17, 2018
  22. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    1. If the textures are there and looks valid then the "hardest" part is complete.
    2. Just checking.
    3. That should be fine
    4. I haven't tested 2018.2, but what sounds most weird to me is that you've tested a wide array of 3d tools and none of those can find the textures. To me this indicates that the way I generate the texture names breaks on 2018.2
    Unfortunately with the holidays coming up I wont have time to look into this right now. I do consider this a priority but family comes first. Hopefully I'll find time before the new year, but no promises on that score.
     
  23. MrTabris

    MrTabris

    Joined:
    Feb 28, 2015
    Posts:
    2
    Hi,

    I just bought your plugin, and I can't make it work on Unity 2018.2.17f1 (64-bit) .
    The menu "Window|Unity Fbx Exporter" didn't appear.

    Any help ?
    Thanks
     
  24. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    I just tested 2018.3.4f1 and 2018.2.16f1 since that are the versions I have on my system, everything worked nicely so I'll take the leap of faith and assume there isn't anything wrong with 2018.2.17f1.

    So let's take a more in-depth look at your setup.
    1. What windows version do you have?
    2. Does the path Assets/Plugins/UnLogickFactory/FbxExporter exist in your project?
    3. Does your project have any compile errors?
     
  25. MrTabris

    MrTabris

    Joined:
    Feb 28, 2015
    Posts:
    2
    Thanks for your feedback it's working. I've launched the plugin in a new project and worked. I just had to reimport my package into the new project.
     
    UnLogick likes this.
  26. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    119
    @UnLogick : I have a problem with the plugin on a Windows Server 2012 R2.
    I built a 64 bits app using your plugin.
    When running the app, and trying to export the FBX file, here's the error that I have :


    Application.streamingAssetsPath=C:/Users/[...]FBXGenerator_Data/StreamingAssets
    FBXAutoExport.ExportScene -> Error during call to ExportModelsAndAnimations: System.Exception: Fbx Exporter - DLL unable to load!
    The Fbx Exporter DLL was located at C:/Users/[...]FBXGenerator_Data/StreamingAssets\Plugins/UnityFbxExporter_x86_64_v14.dll but failed to load.
    at UnLogickFactory.UnityFbxExporterBinding.Init (System.Int32 logLevel) [0x000c6] in <2d04d4b1a1cd4fb4973466eea3133382>:0
    at UnLogickFactory.FbxExporter.GetDefaultFormat () [0x00000] in <2d04d4b1a1cd4fb4973466eea3133382>:0
    at UnLogickFactory.FbxExportSettings..ctor () [0x0000b] in <2d04d4b1a1cd4fb4973466eea3133382>:0
    at FBXAutoExport.ExportModelsAndAnimations (UnityEngine.GameObject[] objects, System.String _fileName) [0x000b1] in <2d04d4b1a1cd4fb4973466eea3133382>:0
    at FBXAutoExport.ExportScene (System.String _fileName) [0x00273] in <2d04d4b1a1cd4fb4973466eea3133382>:0

    I tried to put the dll next to the .exe but that didn't change the problem.
    Is there some Visual Studio redistribuables that need to be installed ?
     
  27. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    "The Fbx Exporter DLL was located at" that indicates the dll was successfully found on your system. So there should be no need to move it.

    I specifically said to static link stuff, but my c++ linking skills are not flawless, so I can't rule out that possibility entirely. If we're looking at a missing Visual Studio redistributable it would be either 2010 or 2015 I can't recall which. So first order of business would probably be to install these.

    Please let me know if that resolved the issue before we bring out the big guns.
     
  28. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    119
    @UnLogick : thanks for the quick answer.
    I manage to make it works by installing all redistribuables between 2010 => 2017 (a bit heavyweight, but I would need those anyway for other apps...)
     
  29. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    @Pode : good to know, I guess I should find out which specific version I'm dynamically linking and add that to an FAQ. Or I could look into how to actually static link it. On the windows platform I doubt anyone would mind the extra file size.
     
  30. Zaxil243

    Zaxil243

    Joined:
    Aug 24, 2017
    Posts:
    1
    Hey UnLogick i got your package and when I try to export an fbx I made the texture's material tiling gets all screwed up when I look at it via an fbx viewer. For instance say I have the texture tiling at X = 1 and y = 2, when I export this fbx the tiling goes back to x=1 and y =1 in appearance.Any idea how to keep the textures proper tiling when I export the fbx?
     
  31. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    Actually I tried looking into this more than a year ago and none of the numbers made sense. There seem to be a lot of magic going on with the material scale and offset that counteracts anything I try to do. I'll try to take a look at this again to see if I can see the pattern that eluded me last time.
     
  32. Maxie999

    Maxie999

    Joined:
    Aug 31, 2019
    Posts:
    1
    I can't seem to get bone rotation to export properly any tips?
     
  33. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    That should just work, I need more data(tm), pics or it didn't happen. :)
     
  34. jcdivika

    jcdivika

    Joined:
    Jan 6, 2020
    Posts:
    1
    Hi! I just purchased the asset but it looks like it doesn't do what I needed it to do. I need to export an FBX of a humanoid rig that has some animation. Can you please help me to see if this is possible? Thank you.

    Edit: Im using Unity 2018.4.14f1 Personal edition
     
    Last edited: Jan 7, 2020
  35. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    The Fbx Exporter can export the rig, but it cannot export the animations(I am not aware of any fbx exporter for unity that is capable of exporting animations). If you're unhappy with the fbx exporter you can pm me the invoice number and I'll tell Unity to get you a refund.
     
  36. TOES

    TOES

    Joined:
    Jun 23, 2017
    Posts:
    59
    I had problems exporting buildings made with Buildr2. When importing the FBX in Blender (2.80) I get loads of black lines connected from origo to each object. When I try to remove the lines the objects get all messed up. How to fix?
     

    Attached Files:

  37. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    I've seen lines like these before in blender. They're actually blenders way to visualize the "transform" hierarchy. They will not show up in an actual render. The lines start in origo because that's where the fbx root object is. There are multiple ways to deal with this, on top I'm fairly certain you could turn it off in blender.

    I don't know exactly what hierarchy Buildr2 makes since I've never used it but previously I've had success selecting all renderers in the unity scene (search "t:Renderer") and use the "export selected objects as a single fbx" option. Just be aware this can produce problems if some of your objects are SkinnedMeshes! You can ask the BuildR2 guy to reach out to me with a voucher and I could easily make a button that would export their stuff without this annoying quirk.
     
  38. TOES

    TOES

    Joined:
    Jun 23, 2017
    Posts:
    59
    I found a workaround, which is exporting to OBJ then importing the OBJ back again. Got rid of that extra stuff generating the lines. It would be nice to investigate the issue further though, as I saw those earlier too in some other project.
     
  39. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    If this exercise means you can produce two fbx files, one generated by my exporter with the lines, and another fbx with the same meshes that doesn't contain the lines I can analyze the differences and match that. One of the biggest problems with the fbx format is that there are multiple ways of doing everything but the importers usually only support one or two. So it's easy to export something that is technically valid but just gives random errors in some apps.
     
  40. MuroStudios

    MuroStudios

    Joined:
    Aug 4, 2015
    Posts:
    4
    Hi Joen,

    we were wondering if your fbx exporter could help in optimizing our environment art?
    Currently we have a huge amount of separate objects that are static in the scenes in our game and we were wondering if exporting them in bigger groups as one mesh (fbx) would optimize our scene? What do you think would this affect at all as all the environment objets in our unity scenes are static anyways?
    Could you give a one day trial for your asset so we can try this out without paying the whole price just to see if it helps?
     
  41. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    My fbx exporter does not alter the number of meshes, so it is very unlikely to yield the results you're hoping for.

    What you're looking for is called mesh combining. There is a Unity api for this: https://docs.unity3d.com/ScriptReference/Mesh.CombineMeshes.html you can also find several bits of code doing this rather trivial data processing online.

    However all of these requires a coder and only works when your meshes uses the same materials. Then you can start texture combining and so forth, if it's a real world messy scene then you're probably better off just buying one of the asset store packages designed for this. I choose not to mention any of them as I've never worked with any of them. But a search for: "unity mesh combining asset store" brought me several that looked promising.

    Just as a gimmick I tossed in "unity mesh combining opensource" and found several, most seemed to be your regular naive implementations just tossed out there if one is interested, but I found one which stood out both by mentioning numbers and which goes quite in depth about when it's a good idea and what the costs are.
    https://github.com/ncgreco1440/MeshBakery

    If for some reason you want to combine any of these solutions with my fbx exporter, go ahead and buy it, if it doesn't perform as you expected just ping me back and I'll issue you a refund.
     
    MuroStudios likes this.
  42. lee3

    lee3

    Joined:
    Jan 14, 2016
    Posts:
    1
    i uploaded the sample model - but it appears all white. any idea? thanks.
     
  43. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    The textures are in png files in the texture folder next to the fbx file, you probably need to include those as well.
     
  44. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    865
    Hello, I'm trying to fix a problem and I'm wondering if your asset can help.

    I've been struggling with the fact that the model importer creates gameobjects with scale values not equal to 1 if the FBX was not exported with the correct unit measurements.
    I have made a thread about this here and not having the scale values of 1 can have annoying consequences, like here amongst other things.

    This can be fixed by re-creating a new FBX asset with the correct unit measurements. However when you need to change a large amount of fbx files, it's really problematic to do it one by one.

    Does your asset provide a way to change an FBX's file scale in Unity?
    or to somehow modify the transforms of the gameobjects so that they are equal to 1?
     
  45. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    It would probably be easy to let you set this when writing an fbx file. However my tool doesn't work with animations and based on your thread that was a major part of your problems.

    I would imagine that the "easiest way" to fix this would be to hook into the asset pipeline and look at the size of the model, if it's too large or too small you scale it up or down x10 or x100 based on what makes most sense. I could add such a script to the fbx exporter, it's slightly off topic, but still within reason.
     
  46. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    865
    Alright, best you don't do this then, thanks for the information.
     
  47. tspree15

    tspree15

    Joined:
    Oct 25, 2011
    Posts:
    28
    Hi, I'm trying to export Unity Terrain tiles (I have about 10 terrain tiles all with high resolution textures) and for some reason the fbx isn't exporting with the terrain textures. Is there a trick to it? Thanks
     
  48. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,659
    I haven't tested against the upgraded terrain, maybe something gets lost there, I will test tonight. What version of unity and please throw in a screenshot of the exporter settings as well as what's in the fbx folder + texture folder.
     
  49. tspree15

    tspree15

    Joined:
    Oct 25, 2011
    Posts:
    28
    Thank you for the quick reply. I think I figured it out. If I have another issue I'll let you know.
    Appreciate the great support.
     
    UnLogick likes this.
  50. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    10
    Hello, I just bought the asset and there is indeed export problems with terrain with Unity 2019.3 (no texture, everything is black + no trees/details)
     
unityunity