Search Unity

[RELEASED] UniFBX (2) FBX Mesh Importer At Runtime

Discussion in 'Assets and Asset Store' started by carlossarria00, May 23, 2016.

  1. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    UniFBX (2)

    Sometimes, we need to load 2D/3D assets at runtime in our unity application. We can do this by saving it into the Resources folder in the unity editor and they’ll be availables after compilation to load them at any time. The Asset Bundles is an option to store assets to load them from a hard disc, an sdcard or, even, a server location. However, all these options need to use unity editor and, the asset bundles case, Unity Pro Edition is required
    a0f413cc-922d-4f97-b060-be95b6551cd2.jpg
    Release: https://www.assetstore.unity3d.com/en/#!/content/61108


    Demos:


    UniFBX (2) Standalone Win

    UniFBX (2) Standalone Mac


    Features:

    1. This library works with 2D/3D models imported from FBX SDK 2012, 2013, 2014, 2015, 2016.

    2. ASCII importation from 3D Editors like Maya, 3DMax, Cinema4D.

    3. Setting folder or URL containing FBX files

    4. Setting folder or URL containing JPG, PNG, DDS, TGA format for textures (embedded textures or not)

    5. Main thread or async load mode implemented.

    6. Meshes importation with global scaling, normals, tangents and collider type, selectables.

    7. Materials and textures importation.

    8. Standard or Legacy Material.

    9. Lights, cameras and TRS animation importation.

    10. Web player (Depreciated), Standalone (Linux, Win and Mac), Android, iOS, WebGL supported. Unity Personal and Pro editions.

    11. Faster than previous UniFBX UniFBX Release 1

    12. Complete C# source code. No DLLs


    Videos:



     
    Last edited: Jun 1, 2016
    HonFai likes this.
  2. HonFai

    HonFai

    Joined:
    May 23, 2016
    Posts:
    6
    Hi carlossarria00, I tried the new version UniFBX 2 demo, it can't import texture. But I tested on old version, it can import the texture. The model generated from Recap 360. Attached file is one of the example, please help. And may I have android version for testing?
     

    Attached Files:

    Last edited: May 30, 2016
  3. HonFai

    HonFai

    Joined:
    May 23, 2016
    Posts:
    6
    Hi carlossarria00, I tried the FBX with animator, but the animation and the texture doesn't import. Please help! Thanks a lot!
     
  4. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    Hi HonFai

    Please, downalod and try the demo again. I correct something in some script. Now, your "teadrink.fbx" model should load the texture
     
  5. HonFai

    HonFai

    Joined:
    May 23, 2016
    Posts:
    6
    Hi carlossarria00,

    Where can I download the new version? I tried the asset store demo and the above link again, and I get the same result, the texture also can't import.
     
    Last edited: Jun 1, 2016
  6. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
  7. HonFai

    HonFai

    Joined:
    May 23, 2016
    Posts:
    6
    Hi carlossarria00,

    It works great with UniFBX (2) Standalone Win. I will wait for the Android demo, it is because my project is mainly for Android and PC.

    Thanks a lot!
     
  8. HonFai

    HonFai

    Joined:
    May 23, 2016
    Posts:
    6
    Hi carlossarria00,

    May I know when will the Android demo ready, it is because my project need to hand in this month on 19th.
     
  9. vispan

    vispan

    Joined:
    Jun 11, 2016
    Posts:
    5
  10. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    Hi HonFai

    Here is it: UniFBX (2) Android
     
  11. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108

    Hi Vispan

    FBX files ar not supported by UniFBX (2) yet. It's a work in progress.
     
  12. HonFai

    HonFai

    Joined:
    May 23, 2016
    Posts:
    6
    Hi carlossarria00,
    It works great with UniFBX (2) Android.
     
  13. vispan

    vispan

    Joined:
    Jun 11, 2016
    Posts:
    5
    Is it possible with UniFBX (1) ?
     
  14. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108

    No, binary files is a work in progress for both UniFBX and stream reading as well
     
  15. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Hey, @carlossarria00 !

    Your asset looks nice!
    Here are few questions though:
    - Does UniFBX supports huge models (and bypasses 64k vertexes limit)?
    - are you working on the updates and bugfixes (some very important bugs are mentioned at the asset reviews on the UAS)?
    - what is your progress with binary FBX support?

    Thanks!
     
    carlossarria00 likes this.
  16. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    Hi Dmitriy-Yukhanov

    As the meshes be either quad or triangulated a huge model will be loaded in the scene at runtime. However, take in account that it can take longer. For instance, if you load a huge fbx file about 1GB, a 32 bits operating system the application crashes. It is always recomended use files about 20MB (although a 200 MB can be loaded) for a faster operation.

    Yes, this asset just can handle upto 64K vertices. Unfortunately, split meshes for more then 64K vertices is not contemplated in this asset.
     
  17. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Thanks for your reply!
     
  18. pakmafia

    pakmafia

    Joined:
    Feb 24, 2011
    Posts:
    43
    Hi, I am looking for asset that would allow the end user to import a fbx model from a website url. I am hoping that this asset would allow me to do that but i am not getting the desired results from the windows demo everything is empty and there is no optin to add url path to the 3d fbx file.
    see my screenshot and tell if this is correct or am i doing somthing wring?
    Thanks
     

    Attached Files:

  19. pakmafia

    pakmafia

    Joined:
    Feb 24, 2011
    Posts:
    43
    2 days since I posted my question and no one responded I guess that answers my question that this asset does not work and it is no longer supported.
     
  20. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    Hi pakmafia

    Believe me that I had not any notification about yout post. Answering your question, yes, you could add an url and download the 3D model. Really, what the asset does is parser the 3D model file and convert it in unity 3d model.
     
  21. Deleted User

    Deleted User

    Guest

    hi!
    its really a nice asset!
    but, I have some trouble when I using your asset

    1) When I import my fbx file, the child object is not in the correct position, to see the picture I uploaded

    2)What does the "GeometricTranslation" mean in the FBX file? and,Question 1 is related to this field? looking forward to your reply
     

    Attached Files:

  22. tsipfvadim

    tsipfvadim

    Joined:
    Aug 20, 2016
    Posts:
    3
    Hi carlossarria00!
    I tried android demo, it don't work (Status:FileNotFound). Can you help me?
     
  23. naojitaniguchi

    naojitaniguchi

    Joined:
    Apr 16, 2014
    Posts:
    1
    Hi carlossarria00!

    UniFBX (2) suppers mesh division for large FBX model ?
     
  24. CommanderThrawn

    CommanderThrawn

    Joined:
    Dec 22, 2014
    Posts:
    5
    Ummm, what's the point of an fbx importer that doesn't support binary .fbx files? Does version 1 support binary?
     
  25. PartDB

    PartDB

    Joined:
    Jul 21, 2015
    Posts:
    3
    Texture does not appear in model
    It's also different from the UI you see on YouTube.
     
  26. PartDB

    PartDB

    Joined:
    Jul 21, 2015
    Posts:
    3
    Texture does not appear in model
    It's also different from the UI you see on YouTube
     

    Attached Files:

  27. PartDB

    PartDB

    Joined:
    Jul 21, 2015
    Posts:
    3
    Can not I import an FBX file in binary form?
     
  28. MikeEnoch

    MikeEnoch

    Joined:
    May 31, 2014
    Posts:
    6
    Hi @carlossarria00,

    I've been testing the included sample scene in the latest asset store version to figure out how your importer works. I have to say that it has been quite frustrating to debug even the most basic problems, like when I had an issue with getting textures to load on the included sample models. This turned out to be a bad path string, but there's very little error checking and no console log output at all to let you know what's going wrong - I had to add my own debug logging inside your functions to figure it out. You really should add more log file output, it's quite a fundamental problem with selling a piece of code like this.

    After fixing that I'm still having trouble when importing the included rabbit.FBX example file, see the attached image. The eyes and other sub-mesh models aren't loading correctly into place on the model. Presumably it's a translation or hierarchy problem? Looking at the way Unity imports the model in the editor I can see that this isn't an issue with the file (Unity correctly shows the rabbit's eyes in their sockets in the preview) - but with the runtime import. Am I missing some setting that will fix this? I've tried various options in the importer but it's taken a lot of time just to get this far.

    I'll dig through the code again, as with the textures, but it would really help if you could post better information on how to use the demos (and indeed the included files in the actual asset - where your documentation is minimal to say the least...)

    Thanks for any help,

    Mike.
     

    Attached Files:

  29. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    where may I find this?
     
  30. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    Hi trdpro:

    3LqpXMeXB8j8dmNXMUBzYfmbsUsF6pwFd2
     
  31. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    What does that mean?
     
  32. tredpro

    tredpro

    Joined:
    Nov 18, 2013
    Posts:
    515
    Well it's working in the asset store again
     
  33. no1caresme

    no1caresme

    Joined:
    Mar 6, 2017
    Posts:
    2
    Hi carlossarria00,

    I've been testing the included sample scene in the latest asset store version and had an issue with getting textures to load on the included sample models. I am not sure whether I had the wrong setting or not.

    Please advice. Thanks for any help!

    Capture2.PNG
     
    Last edited: Mar 6, 2017
  34. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    Are you sure that textures don't load?

    unifbx2_load_textures.JPG
     
  35. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    Please, try to check the fbx setting as shown above

    unifbx2_load_textures.JPG
     
  36. carlossarria00

    carlossarria00

    Joined:
    Feb 25, 2014
    Posts:
    108
    Just set the texture import as "YES"

    unifbx2_load_textures.JPG
     
  37. no1caresme

    no1caresme

    Joined:
    Mar 6, 2017
    Posts:
    2
    Hi carlossarria00,

    Thanks for the help. I found that I miss "file:///"in the Texture Folder, "file:///" in URL is auto omitted at running time.


    Capture1.PNG
     
  38. opponent019

    opponent019

    Joined:
    Feb 6, 2014
    Posts:
    28
    Hi, I haven't managed to load textures so far, I get this error:

    Code (CSharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. UniFBXTexture2D.LoadTextures_PNG (System.String filename, System.Byte[] bytes, UnityEngine.Material material, System.String channel) (at Assets/CSUE/UniFBX/Lib/UniFBXTexture2D.cs:455)
    4. UniFBXTexture2D+<IColormap2>c__Iterator4.MoveNext () (at Assets/CSUE/UniFBX/Lib/UniFBXTexture2D.cs:287)
    5. UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    6.  
    The 0 - 100% progress bar never gets to 100%, always stays between 60% - 80% as well for some reason, without giving any other error.

    upload_2017-4-16_13-59-1.png
    I also tried with a Blinn material, same results

    upload_2017-4-16_13-59-41.png

    The app I'm working on is for Android only, if that makes any difference.
     
    Ignatius likes this.
  39. opponent019

    opponent019

    Joined:
    Feb 6, 2014
    Posts:
    28
    @carlossarria00 please, I really need to solve this, do you have any idea of what could be causing that problem?
     
  40. opponent019

    opponent019

    Joined:
    Feb 6, 2014
    Posts:
    28
    I'd been exporting the models with Blender but I tried exporting with Maya and it did import the diffuse but not the rest of the textures (normal and spec), tried with another model exporting from Maya as well and now it's doing the same with the "?" images as diffuse. The first model, the one that successfully imported diffuse, only had one material, the second model has two.
     
    Robintj likes this.
  41. OrekaIngenierie

    OrekaIngenierie

    Joined:
    Jul 6, 2012
    Posts:
    67
    Hi carlossarria00,

    I've tried a WebGL build on a local server, but i can't load my model. It's say : "UnknownError".
     
  42. Senior1

    Senior1

    Joined:
    Apr 3, 2017
    Posts:
    2
    Last edited: Jun 2, 2017
    stoneedge likes this.
  43. FullDiver

    FullDiver

    Joined:
    Jun 13, 2017
    Posts:
    3
    Hello @carlossarria00,

    I'm kind of unfamiliar with Unity, licensing and the industry in general, so I was wondering:
    If, as a developer, I purchased UniFBX2 and created a game using it (which may or may not be free), then built and distributed said game, how would that work with regards to intellectual property rights and all that? Are there any fees or things of the sort concerning that kind of thing?
    Another small but nagging (and most likely stupid) concern: would my users also have to have UniFBX2? Probably not, but something like that would be a huge game-changer, so I have to ask, just in case.

    If things turn out well for me, then thanks in advance for making such a great asset. Runtime importing of an FBX was a huge problem, and you've made my life a lot easier.
    If not, thanks anyway. You've still done marvelous work here, regardless of whether I could use it or not.
     
  44. FullDiver

    FullDiver

    Joined:
    Jun 13, 2017
    Posts:
    3
    Hello @carlossarria00,

    I'm leaning towards getting this now soon, all things considered. I do have another concern however. Your Asset specifications say that it supports TRS animation. Just to be clear, does that mean I can translate, rotate and scale individual bones of a model? Or am I limited to translating/rotating/scaling the entire model as a whole?

    Some help would be appreciated. Deadlines are coming up and I'm kind of panicking.
     
  45. Ignatius

    Ignatius

    Joined:
    Oct 28, 2013
    Posts:
    10
    Hi carlossarria00,
    Thanks for the great tool you developed. Here are some question and checklist I did for your references.
    My issues are:
    1. Somehow UniFBX could only retrieve 1 item from listMaterials, which is always diffuse. My fbx contain 3 map: Diffuse, Normal, and Specular. I had used Debug log on nearly all critical handlers, but having hard time to located the function which handling deserialize acsill file. I had attached and explained what I found during the testing.
    I had uploaded those fbx and texture on my server. The path in attachment is valid. You could test it. I also screen shots all settings, and export setting used.

    Here is short summary for settings applied:
    fbx export:
    fbx version: 2014/2015 (I also tested on 2012, the problem is same)
    triangular: true
    no sub object, only grouping was applied. (I also tested with no grouping)
    Standard material with Diffuse, Specular, Bump map was used. All these file was uploaded on server with same folder as fbx.

    2. My second issue is, the model imported has different rotation as in 3dsMax, did I miss up anything while export or runtime importing?

    Most detail are stated in attachment.

    Cheers,
    Ignatius
     

    Attached Files:

  46. Ignatius

    Ignatius

    Joined:
    Oct 28, 2013
    Posts:
    10
    Did you manage to solve the texture loading problem? I also facing the same issue.
     
  47. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    yes,great tool ,it's work for 3ds max 2014 fbx ASCII format ,
    but I want to give some suggestion here,
    1:support fbx byte format,
    2: if step 1 is difficult,try to use MeshSerializer reduce fbx float data to byte,
    3:current version still slowly!!
     
  48. Maarten_AryzonTeam

    Maarten_AryzonTeam

    Joined:
    Sep 29, 2016
    Posts:
    13
    For anyone who has texture import trouble for embedded textures, try changing line 91 of file UniFBXTextures.cs from:
    Code (CSharp):
    1. else if (UniFBX.list[k].Contains ("Filename: ")) {
    to:
    Code (CSharp):
    1. else if (UniFBX.list[k].Contains ("RelativeFilename: ")) {
    Took me quite some time to figure out why it wasn't working. It references the full file path, for embedded it should use the relative file path. Not sure if this creates / solves other problems.
     
  49. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    if you select embedded textures,the textures will be convert to base64 string embed in fbx file,
    and the path only mean nothing but a name.
     
  50. Maarten_AryzonTeam

    Maarten_AryzonTeam

    Joined:
    Sep 29, 2016
    Posts:
    13
    True, something else must be going wrong. Somehow above solution works for me. I figure it won't work for all relative paths, like ones with ../ in the name.