Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

[Released] TriLib - Model loader package

Discussion in 'Assets and Asset Store' started by rickomax, Jun 21, 2017.

  1. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    TriLib is a Unity model loader package designed to allow the user to load various 3D model formats inside the Unity editor or during the game execution.
    • Imports over 40 file formats.
    • Supports external and embedded materials.
    • Supports skinned meshes and animations.
    • Mesh post-processing features.
    • Multi-platform: Windows, Linux, OSX, Android and iOS.
    Asset store link:
    https://www.assetstore.unity3d.com/#!/content/91777

    Known issues/limitations:
    https://ricardoreis.net/?p=127

    Basic usage:
    https://ricardoreis.net/?p=341

    Accepted file formats:
    https://ricardoreis.net/?p=81

    We suggest downloading the test application for testing your models:
    https://ricardoreis.net/trilib/trilibtest.zip

     
    Last edited: Jul 18, 2018
    mgear likes this.
  2. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    714
    Great stuff
     
  3. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Thank you sir :)
     
  4. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    TriLib 1.1 upgrade awaiting Asset Store approval.

    On this update:

    Fixes:
    *Fixed general issues
    *Fixed shader issues (materials wasn´t loading outside editor)
    *Fixed embbeded textures loading
    *Added Avatar Loading class
    *Added experimental DevIL support (Windows only)

    Additions:
    *Added menu items to activacte/deactivacte debug mode and DevIL library

    Known issues added:
    *If embbeded compressed texture resolution is not power of 2, it won´t load correctly. Will be fixed in next release

    Avatar loading class sample:
     
  5. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    IMPORTANT:
    For anyone having problems with TriLib material loading, a new patch is waiting aproval on Asset Store.

    Any other issue, please e-mail me at:
    ricardo@ricardoreis.net
     
    zyzyx likes this.
  6. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Patched version released
     
  7. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Hey guys, just to send an updated status:

    I'm implementing new TriLib advanced post-processing and loading options, this update is taking a bit longer, but I plan to release it till the ending of the week.

    Many bugs have been fixed, specially FBX related bugs.

    As soon as the new version be online, I will post an update here.

    Regards,
    Ricardo.
     
    Bartolomeus755 likes this.
  8. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    384
    Hi is support for .step files be possible in the future.
     
  9. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    coverpage, it works with IFC files, but I haven´t tested any STEP files (I've heard they have similar structures). STEP files support is on the features wishlist, but I don´t know when it will be implemented.
     
  10. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    188
    Great news, FBX is my main file format for 3d models. Looking forward Ricardo. ;)
     
    rickomax likes this.
  11. kasidier

    kasidier

    Joined:
    Jul 20, 2017
    Posts:
    1
    I tried the demo and imported one FBX file use AvatarLoader.exe is ok. But in the package,I haven't find the avatarloader.cs.And I used the assetloader,imported the same fabx file,and found the texture wrong.
     
  12. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    I've answered kasidier by e-mail. Some information may be useful for who is having texture loading problems:

    At the package root folder we have:
    Standard Assets
    TriLib
    TriLib Extras

    AvatarLoader.cs is inside TriLib Extras.

    About the texture displayed in red and white, its probably because the demo app is outdated. I will release a new update with a lot of fixes very soon. But using the same resource I will explain later (DevIL Image Library) will probably solves your issues.

    When a texture loads the red interrogation symbol, it means the texture format is invalid or DevIL is disabled. When there is a blue interrogation symbol, means the texture file wasnt found.

    About the DDS support, you can enable it on Windows only at the moment by going to TriLib menu inside Unity Editor and clicking "DevIL Enabled".

    (Important: DevIL Image Library support is Windows only feature at the moment).
     
    Last edited: Jul 23, 2017
  13. teacoat

    teacoat

    Joined:
    Nov 22, 2014
    Posts:
    11
    First off - awesome library its exactly what I was looking for. Any chance you could take a look at expanding the animation import support? I'm having a lot of trouble figuring out how to correctly set up animations for the import to take them correctly. If there is somewhere we can chat a bit quicker than this please let me know!
     
  14. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    First off - Thank you!

    Sure, sent you my Skype via PM.
     
  15. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    TriLib 1.3 is out:

    *Fixed FBX 2015 binary reading bug
    *Fixed FBX embedded materials reference bug
    *Implemented advanced loading configuration
    *Separated Avatar Loader class from UI logic for class reusability
    *Removed the dependency of Standard Assets. Now you can download it separately from Asset Store, and TriLib will configure the Avatar Loader Sample automatically
    *Fixed specular material bugs. (Unity new material system isn´t 100% compatible, so now, by default, TriLib will only use the Unity new Standard Material)
    *Updated documentation
    *Updated TriLib with the latest Assimp version (4.0) which fixes many other 3D format bugs

    Work in progress (for the next version):
    *UWP support
     
  16. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Important:

    Asset Store tools kept an old TriLib package deployed with Unity 5.6.0. This package has some filename issues and should not be used. A new package is being uploaded for Unity 5.6.0. At the moment, the Unity 5.6.2 package is the only updated.
     
  17. mikko_forsman

    mikko_forsman

    Joined:
    Jul 10, 2017
    Posts:
    17
    Hello,

    Will trilib library get support for models that have larger vertex count than the Unity maximum of 65k vertexes? When importing .fbx models in Unity Editor, the importer splits models that exceed the maximum vertex count. But when using trilib and importing a model with higher vertex count, Unity simply throws a runtime error about a model with too many vertexes.
     
  18. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Hey.

    The new TriLib version (1.3) should handle that by default.

    There is a new feature called "Advanced Configs" where you can define the vertex limit and other advanced options.
    The code is already cutting meshes larger than 65000 by default:

    AssetLoaderOptions.cs:
    Code (CSharp):
    1.          /// <summary>
    2.         /// Use this field to define asset loading advanced configs.
    3.         /// </summary>
    4.         public List<AssetAdvancedConfig> AdvancedConfigs = new List<AssetAdvancedConfig>
    5.         {
    6.             new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(AssetAdvancedPropertyClassNames.SplitLargeMeshesVertexLimit), 65000),
    7.             new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(AssetAdvancedPropertyClassNames.FBXImportSearchEmbeddedTextures), true),
    8.             new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(AssetAdvancedPropertyClassNames.FBXImportReadLights), false),
    9.             new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(AssetAdvancedPropertyClassNames.FBXImportReadCameras), false)
    10.         };
    Have you updated your TriLib version?

     
  19. JuliuszK

    JuliuszK

    Joined:
    Dec 22, 2014
    Posts:
    25
    Hi,
    I downloaded the demoApp, placed some FBX files along with their texture maps in the Models folder, but they won't load.
    When I run AssetLoader, all I get is a blank scene, with the inactive Load Asset button. What am I missing?

    Also two more questions:
    1) can this library be used to load textures only? I'm looking for a runtime image importer for formats different than jpg and png.
    2) also - do the models to be imported in runtime have to be in a predefined folder, like that Model in the demoApp? I'd need to be able to load from any location.

    Cheers.
     
  20. ModeLolito

    ModeLolito

    Joined:
    Jun 16, 2016
    Posts:
    17
    Hi , I am a french dev and I work on AR project GARnie on Android.
    I have just discovered your plugin , it seems great.
    I think buy it to use it in my app.

    This app permits to create and share original scenes with 3d models by default or using yours.
    here a demo I made with it.


    Do you want I put the plugin name and your name in credit?
     
    rickomax likes this.
  21. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Hi!

    The button isn´t inactive, you can click it and load any model at the drive you extracted the demo application.

    At the moment you can only load the full model, but I can tweak it to load only the textures. The texture formats TriLib accepts is most notable on Windows only at the moment, where it can use DevIL Image Library which accepts a big range of formats. I'm recompiling DevIL for the other platforms that TriLib accepts.

    The model you load can be anywhere, TriLib just won´t load the models at runtime that you have at the Assets folder after your game package has been deployed, as the resources will be packaged.
     
  22. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Pretty nice app! Love this kind of stuff.

    You can use TriLib freely without giving credits, but if you give me, I would be proud to be on this list :)
     
  23. kachelaar

    kachelaar

    Joined:
    Sep 29, 2016
    Posts:
    10
    Trying out TriLib in my app, works really easy!

    Running into a problem though. I have a fbx file in my Android app which I load through assetLoader.LoadFromFile(message, assetLoaderOptions, wrapper);
    It loads the mesh but the texture embedded in the fbx file does not show up. Instead it loads the blue question mark texture. It does work in the editor (on Mac), am I doing something wrong?

    I exported the fbx file from Maya. The file is really simple, just 1 mesh with a material with a diffuse texture.
     
  24. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Hi!

    Generally the blue question icon means your texture could not be loaded. As your question is specific for Android, I answered you via e-mail.

    Thank you :)
     
  25. Ignatius

    Ignatius

    Joined:
    Oct 28, 2013
    Posts:
    10
    Hi rickomax,

    When I load the fbx file from Android persistent path, the app will crash, the asset is very simple. Just a teapot (animated) with a box as child, and a sphere as child of box.
    I tried with embeded media : it crash too
    I tried without texture attach: if crash too

    Everything is ok while in editor.

    The attach is the build settings.
     

    Attached Files:

  26. DMI_Alex

    DMI_Alex

    Joined:
    Mar 8, 2016
    Posts:
    1
    Hi,

    When using this asset, Unity will crash anytime trying to preview the runtime.

    I get this error

    assimp64.dll caused an Access Violation (0xc0000005)

    using Unity 5.6.3f1

    any thoughts?
     
  27. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Ignatius , please send the models you used for this test to : contato@ricardoreis.net
    I will test it at my device.

    Until that, try to compile your application with "External Access" enabled.
     
    Last edited: Aug 12, 2017
  28. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    DMI_Alex, does this issue ocurrs with any model?
     
  29. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    For anyone having issues with TriLib. I'm answering everybody that comes with an issue. I haven't been having much time to resolve the issues as before, because of some parallel jobs. But I will carefully work on each issue. They're all listed at my mailbox. TriLib UWP support will be a bit delayed to give priority to these issues, but it is already being implemented.
    Also, if you have any issue, send an e-mail to: contato@ricardoreis.net .
     
    Last edited: Aug 12, 2017
    Bartolomeus755 likes this.
  30. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    hi,@rickomax,
    it's seem your plugin create many auxiliary node ,can there be combine one ?
    and will you add progress for loading ? although current there some event can do the same thing .
     
    Last edited: Aug 22, 2017
  31. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Hi.

    It creates auxiliary nodes to FBX transforms due the nature of the many FBX transformation matrices. At the time this code was written, it was decided that this was the best way to deal with these matrices (TriLib uses Assimp internally, so that's a legacy behaviour).

    This is a behaviour that will be changed on the next major update. Please see my following post about your other questions.
     
    Last edited: Aug 22, 2017
  32. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    I would like to tell to new and existing costumers that TriLib is passing by a major update.

    Today, TriLib depends on Assimp, a native plugin (written in C/C++).
    This introduces some issues due to the different architectures of the platforms that it's targeting.
    (For example, some new Android devices don't work well with native plugins on Unity. UWP target raises errors we don't have in other platforms)

    To offer a even more solid experience to my customers, the TriLib loading/post-processing code is being completly rewritted in C#. This change is aiming:

    *Targeting all platforms Unity currently supports.
    *Ensuring the same behaviour for all platforms the new version will target.
    *Making TriLib a more universal solution, that could be used in general C# projects too.
    *Speed-up the issue solving speed, as there will be only one code-base, mantained only by myself.

    For a first release, I'm aiming to provide:

    *FBX loading, including all current bugfixes and many others tracked down from TriLib maillist.
    *Editor model loading, as it currently exists.
    *The only post-processing feature that will be implemented at the first moment are: splitting meshes by vertex count and normals generation.
    *Stream loading feature.
    *Multi-threaded loading.

    For future releases, I will be implementing the exporting features and new importing formats based on customers feedback.

    Existing customers: TriLib current version will continue being supported, but due to the architecture differences citted above, some issues may take a bit longer to be solved. Also, I always answer and look for solutions as soon as I receive the e-mails.

    For who is interested in news about this major TriLib update, please subscribe to our newsletter:
    http://ricardoreis.net/?page_id=192

    Best regards,
    Ricardo Reis.
     
    Enoch, mfleurent and Bartolomeus755 like this.
  33. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    188
    Great news Ricardo, looking forward to the new version! :)
     
  34. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    some suggestions
    1. Please don't rename my model when importing to unity use same name Wrapper_RootNode;
    2:remove all auxiliary nodes ,and don't rename my node's.name for some special use.
    3.consider support openctm format for export/import. for webgl use,such like three.js ,ect..
    thank you.!
     
  35. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Thank you for the suggestions!
    They will be considered for the update.
     
  36. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    hi,@rickomax,
    it's seem you calculate triangles or tangents is not correct ,to some material have normal map turn black. will you fixed that ?

    from assetloader .cs 560
    mesh.triangles =? value seem not correct ,for normal map .
    will you check that ?
     
  37. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    upload_2017-8-28_17-11-27.png
    use some code fixed.
     
  38. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Thank you for the tip!

    Maybe internal Assimp code is not working right (it's supposed to generate tangents and bi-tangents, with the right loader option enabled)
    I will take a look as this issue.
     
  39. CloudWeight

    CloudWeight

    Joined:
    Jul 16, 2014
    Posts:
    169
    Hi, I'm currently using a free script for .OBJ runtime importing but I'm finding that I need to retain transform positions and .OBJ seems to lose and reset them to 0,0,0 on export. Do you know if FBX or 3DS retain their transforms when importing at runtime? I'd be interested in buying this asset if this is the case as it's a deal breaker for me :)
     
  40. mikko_forsman

    mikko_forsman

    Joined:
    Jul 10, 2017
    Posts:
    17
    Hello,

    If I have some very large models that I want to import (which can take multiple seconds to load), is there a possibility to do the loading asynchronously in a coroutine so that the UI doesn't get blocked?

    EDIT: Another question that also came into mind: for example in IFC models, there might be some custom metadata that is added to the objects. Is there ever going to be a possibility for also retrieving such customized data when loading the models, or is a manual parser required?

    Regards,
    Mikko Forsman
     
  41. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    You could try downloading the test application to see if your objects are on the right positions:
    https://drive.google.com/open?id=0ByIuTq27JG1qQi1wd2VCd0pVYXM

    FBX does retain the original position when importing. I'm not sure about 3DS, as I haven't tested many models yet.
     
  42. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Mikko, the async loading is a TriLib 2.0 feature under development.

    I'm not sure if implementing multi-thread on the actual version (with C++ backend) would be a cross-platform solution.

    You can subscribe to TriLib newsletter, where I will post updates about the 2.0 version:
    http://ricardoreis.net/?page_id=192
     
  43. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    what's new for 1.4 version?@rickomax
     
  44. Kubic75

    Kubic75

    Joined:
    Jan 2, 2017
    Posts:
    73
    Will iOS be supported?
     
  45. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Hi.
    The 1.4 update fixed a bug with Cinema 4D FBX files that were being loaded with 0 (zero) animation lengths.
    The demo application has been updated, and can load models from any disk unit from the user system.
    There are some bugfixes made by the Assimp colab team. (I will be tracking these, as we don't have an official changelist, yet)
     
  46. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Yes. But only on the next major update (2.0).

    I will be releasing news about this version on the newsletter:
    http://ricardoreis.net/?page_id=192
     
  47. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    hi,rickomax,what's your default units?
    we found our fbx units is mm,but when import your plugin ,it's become Meters,instead millimeter
    are there any options to set this,
    this is very import bug!!!!!!!
    I found these option scale can fixed that problem.
     
    Last edited: Sep 7, 2017
  48. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    upload_2017-9-7_17-51-47.png
    hi,@rickomax ,the left is your plugin import model,and right is unity model,
    and there seem to the import material uv is not correct!.
     
  49. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    188
    Layola, could you send me the file via contato@ricardoreis.net ?

    With the file I can take a look at this issue.

    About the units issue, I don't think Assimp actually handles this, but I will confirm and tweak the code if needed.
     
  50. ignavus

    ignavus

    Joined:
    Mar 19, 2016
    Posts:
    1
    Is there an ETA on UWP support? would love to use this on HoloLens!

    We have build Assimp for UWP, and we can import models but synchronicity is a problem that causes stutter while loading models and the lack of Async image loading in unity makes loading texture a stutter nightmare, and we haven't expanded our module to work with skinned mesh or animation yet.

    Would love to try your asset once UWP support has rolled out.