Search Unity

  1. Unity 2019.1 is now released.
    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,578
    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:
    565
    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,578
    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,578
    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,578
    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,578
    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,578
    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,578
    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:
    107
    @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,578
    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:
    565
    @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,578
    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,578
    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,578
    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:
    107
    @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,578
    "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:
    107
    @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,578
    @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,578
    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.