Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. 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

TriLib - Model Loading Package

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

  1. centur10n

    centur10n

    Joined:
    Jan 28, 2014
    Posts:
    6
    Can't compile 1.8 with Unity 2017.3.1. Have 2 compilation errors...

    Code (CSharp):
    1. Assets/TriLib/TriLib/Scripts/AssetLoader/AssetLoaderBase.cs(863,94): error CS0103: The name `vertexCount' does not exist in the current context
    2.  
    3. Assets/TriLib/TriLib/Scripts/AssetLoader/AssetLoaderBase.cs(1112,9): error CS0103: The name `options' does not exist in the current context
     
    Last edited: May 29, 2018
  2. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Please download the beta package again. These issues have been fixed.
     
  3. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Please send me your invoice info via e-mail:
    contato@ricardoreis.net
     
  4. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    For anyone experiencing issues with Unity 2017/2018 a patch is avaliable at:
    https://ricardoreis.net/?p=217 (just select any version)

    This patch will be avaliable on Asset Store soon.

    Best regards,
    Ricardo Reis.
     
    Bartolomeus755 likes this.
  5. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    958
    Is WebGL on the latest version
     
  6. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    please support utf-8 path .
     
    julienranchoux likes this.
  7. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi. WebGL is not supported yet.
     
  8. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    958
    Is it on the roadmap
     
  9. julienranchoux

    julienranchoux

    Joined:
    Oct 2, 2017
    Posts:
    11
    Hi,

    It's not possible to open a file from local network.

    System.Exception: Error loading asset. Assimp returns: [Unable to open file "Y:XXXXXX
    at TriLib.AssetLoaderBase.InternalLoadFromFile (System.String filename, TriLib.AssetLoaderOptions options) [0x00046] in E:\UNITY\XXXX\XXXX\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:667
    at TriLib.AssetLoader.LoadFromFile (System.String filename, TriLib.AssetLoaderOptions options, UnityEngine.GameObject wrapperGameObject) [0x00004] in E:\UNITY\XXXX\XXXX\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoader.cs:31
    at LoadModelByPath.LoadModel () [0x0001d] in
    E:\UNITY\XXXX\XXXX\Assets\SCRIPTS\LoadModelByPath.cs:36
    UnityEngine.Debug:LogError(Object)
    LoadModelByPath:LoadModel() (at Assets/SCRIPTS/LoadModelByPath.cs:74)
    LoadModelByPath:Start() (at Assets/SCRIPTS/LoadModelByPath.cs:19)


    Do you have an idea ?

    Thanks.
     
  10. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    What's the platform and Unity version you're using?
     
  11. julienranchoux

    julienranchoux

    Joined:
    Oct 2, 2017
    Posts:
    11
    I use Unity 2017.3.1f1 on windows 10 64 bits.
     
  12. mikko_forsman

    mikko_forsman

    Joined:
    Jul 10, 2017
    Posts:
    22
    Hi,

    I'm having some issues with loading of materials in some IFC models using trilib. Here is an example (downloaded from http://openifcmodel.cs.auckland.ac.nz/Model?sortField=Name&sortDirection=ascending&page=2):


    Model in Solibri model viewer


    Same model loaded with trilib


    Warnings printed in console if trilib debug logging is toggled on

    These color issues seem to be somewhat random, some ifc models work ok, some work partially and some don't work at all.

    Similar issues are also present with alpha materials, where they never have any transparency in them even if the alpha -options are toggled on in AssetLoaderOptions. Do you have any idea what could be causing these issues?

    Best regards,
    Mikko Forsman
     
  13. zakmackraken

    zakmackraken

    Joined:
    Jun 16, 2017
    Posts:
    9
    Getting the following with the last few releases of TriLib:

    Assets/TriLib/TriLib/Scripts/AssetLoader/AssetLoader.cs(5,32): error CS0246: The type or namespace name `AssetLoaderBase' could not be found. Are you missing an assembly reference?

    On 2017.1 and 2018.1 on MacOS.

    Thank you.
     
  14. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi!

    TriLib UWP issues have been fixed on latest update.

    You can download it before it's available on Asset Store:
    https://ricardoreis.net/?p=217 (both Beta and Stable versions are the same)

    Changelog:
    Fixed: NET 4.6/NET Core issues/samples compatibility.
    Fixed: NET 4.6/NET Core deprecated methods.
    Fixed: WrapperGameObject is now being used on object loading methods.
    Fided: AssetLoaderAsync "null onAssetLoaded" handling.
    Fixed: Material opacity importing.
    Fixed: Misc. issues.

    Best regards,
    Ricardo Reis.
     
  15. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Please try updating to the latest version from the above link.
     
  16. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi Mikko.

    Assimp team is working on IFC material issues. TriLib Assimp version is a bit outdated, but it will be even with the latest Assimp version on the next update. I'll ask Assimp team members and check if they have fixed the issues regarding IFC materials.
     
  17. mikko_forsman

    mikko_forsman

    Joined:
    Jul 10, 2017
    Posts:
    22
    Okay, thank you for the reply.


    Another question, do you have any update on the status of the .STP file support?
    Best Regards,
    Mikko Forsman
     
  18. byunghwl

    byunghwl

    Joined:
    Jun 13, 2018
    Posts:
    3
    Hello, I recently purchased your plugin and have a similar problem above.
    My platform is Oculus Go(Android) which uses "Snapdragon 821" as CPU.

    D Unity : Unable to lookup library path for 'libassimp', native render plugin support disabled.
    E Unity : Unable to find libassimp

    Can I ask you the schedule for supporting this Armv8-A architecture?
    I tried the plugin's Beta version on your website but it seems like it is still not support..

    Thanks in advance
     
  19. mborke

    mborke

    Joined:
    Jan 16, 2017
    Posts:
    5
    Hi there, I love you product. I just had a question about future support; do you plan on supporting STP files in the future? Thanks!
     
  20. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    958
    up
     
  21. BrandonF_doghead

    BrandonF_doghead

    Joined:
    Apr 17, 2018
    Posts:
    5
    Hey, everyone. I recently came across an issue with the AssetLoaderBase.cs throwing exceptions which could not be caught due to the asynchronous logic within the loader. I modified AssetLoaderBase.InternalLoadFromFile(string filename, AssetLoaderOptions options = null) to not throw exceptions, but instead invoke an event which I setup. I decided to post an unofficial solution on this forum in case anyone else is having this issue, as well as hoping Ricardo Reis will see this and potentially have a proper/official solution. Feel free to implementing my solution listed below:

    1) Declare a delegate inside of the TriLib namespace inside of AssetLoaderBase.cs just like the other delegates listed inside of the TriLib namespace of AssetLoaderBase.cs (Ex: public delegate void OnLoaderFailedHandle(string error, Exception exception);)

    2) Declare an event inside of the AssetLoaderBase class, located in AssetLoaderBase.cs. (Ex: public event OnLoaderFailedHandle OnLoaderFailed;)

    3) Modify AssetLoaderBase.InternalLoadFromFile(string filename, AssetLoaderOptions options = null) to not throw exceptions, but rather invoke out OnLoaderFailed event. Also, we need to change the logic to only call LoadInternal(scene, options); and AssimpInterop.ai_ReleaseImport(scene); when the TriLib loader actually worked. This is what the function should look like after making the necessary changes.

    Code (CSharp):
    1.  protected void InternalLoadFromFile(string filename, AssetLoaderOptions options = null)
    2.         {
    3.             // We must now define our scene variable because of the changes to the logic paths within this function
    4.             IntPtr scene = IntPtr.Zero;
    5.             try
    6.             {
    7.                 scene = ImportFile(filename, options);
    8.             }
    9.             catch (Exception exception)
    10.             {
    11.                 OnLoaderFailed.Invoke(string.Format("Error parsing file: {0}", filename), exception);
    12.                 //throw new Exception(string.Format("Error parsing file: {0}", filename), exception);
    13.             }
    14.             if (scene == IntPtr.Zero)
    15.             {
    16.                 var error = AssimpInterop.ai_GetErrorString();
    17.                 OnLoaderFailed.Invoke(string.Format("Error loading asset. Assimp returns: [{0}]", error), null);
    18.                 //throw new Exception(string.Format("Error loading asset. Assimp returns: [{0}]", error));
    19.             }
    20.             else
    21.             {
    22.                 // Original code does not have the two lines under this line in an else statement
    23.                 LoadInternal(scene, options);
    24.                 AssimpInterop.ai_ReleaseImport(scene);
    25.             }
    26.         }
    4) Create a function inside of the class which you are calling AssetLoaderAsync.LoadFromFile(); from. This will be the function our OnLoaderFailed event invokes. See the function below for an example:

    Code (CSharp):
    1.     void HandleAssetLoaderFailed(string error, Exception exception)
    2.     {
    3.         // ModelLoaderFailedInfo is a custom class to contain the reason why TriLib failed to load the model
    4.         modelLoaderFailedInfo = new ModelLoaderFailedInfo(error, exception);
    5.     }
    5) Lastly, register our function to the OnLoaderFailed event.

    Code (CSharp):
    1.  GameObject spawnedObject = new GameObject();
    2.  
    3. try
    4.             {
    5.                 using (var assetLoader = new AssetLoaderAsync())
    6.                 {
    7.                     assetLoader.OnLoaderFailed += HandleAssetLoaderFailed;
    8.                     var assetLoaderOptions = AssetLoaderOptions.CreateInstance();
    9.                     assetLoaderOptions.AutoPlayAnimations = true;
    10.                     assetLoader.LoadFromFile(fileName, assetLoaderOptions, spawnedObject, delegate (GameObject loadedGameObject)
    11.                     {
    12.                           //This code will happen when the LoadFromFile is done executing, [B]even if it failed[/B].This is why I  had ModelLoaderFailedInfo class.
    13.                         // If the TriLib model loader did NOT fail
    14.                         if (modelLoaderFailedInfo == null)
    15.                         {
    16.                                //Do stuff with the object
    17.                         }
    18.                        
    19.                         // If the TriLib model loader failed
    20.                         else
    21.                         {
    22.                                 //Destroy the object or do whatever you want. You [B]can[/B] call Destroy() here because this code will be on the main thread that Unity runs.
    23.                         }
    24.                     });
    25.                 }
    26.             }
    27.             catch (Exception e)
    28.             {
    29.             }
    If you have any questions, feel free to ask! I will try to answer quickly and help as much as I can. I hope this solution helps, and sorry for the long post! Here is a potato: 0

    Note: Be sure to have "using System;" & "using TriLib" at the top of your file.
    For those wanting to use the ModelLoaderFailedInfo class:
    Code (CSharp):
    1.  class ModelLoaderFailedInfo
    2.     {
    3.         public string triLibErrorMessage;
    4.         public Exception triLibException;      // Can be null
    5.         public ModelLoaderFailedInfo(string ptriLibErrorMessage, Exception ptriLibException)
    6.         {
    7.             triLibErrorMessage = ptriLibErrorMessage;
    8.             triLibException = ptriLibException;
    9.         }
    10.     }
    11.  
    12.     ModelLoaderFailedInfo modelLoaderFailedInfo;
    Edit 1: Fixed formatting issues
     
  22. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi @BrandonF_doghead and thank you for your feedback.
    TriLib already has code to deal with exceptions thrown on other threads.
    I'll take a look at your solution and check if I have missed something on my implementation.

    Thank you!
     
  23. BrandonF_doghead

    BrandonF_doghead

    Joined:
    Apr 17, 2018
    Posts:
    5
    Hey, @rickomax! Sounds good. Thank you for the reply!
     
  24. BrandonF_doghead

    BrandonF_doghead

    Joined:
    Apr 17, 2018
    Posts:
    5
  25. MyOwnGames

    MyOwnGames

    Joined:
    Jul 21, 2014
    Posts:
    21
    Hello everyone,

    I got a few models that do not import with the asset. Everything worked fine with my own models (fbx from Maya and 3Ds), but we got an event tomorrow and I just get the models from my customers (CAD transformed into a fbx) which work partially with Trilib.

    Do anyone knows a pipeline to clean a model so it does work with Trilib ?

    More info :
    I have to download the models from a web server, then save them and vizualize them into hololens headset, and then be able to load them from the datapath without any connection.

    With my models everything works fine. With the others, I managed to load them, save them, and see them from the server ; but when I load them from memory I only got the correct node hierarchy with no Mesh Filters and/or Renderers on it.

    I tried to clean and reduce the mesh (deleting history, curves, cams, lights etc) but nothing did it.

    I sent a mail to Ricardo last week but not sure he'll answer in time...

    If any of you got a idea ?
    thanks
     
  26. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    130
    Hello,

    I am using it on Daydream device - Lenovo Mirage Solo. I get error saying file cannot be opened. I tried FBX, OBJ and IFC file. It doesn't give me anything else about the error. What could it be?

    Thanks.

    Derek
     
  27. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
    hello ,there is a bug compare between unity editor fbx and trilib import fbx

    upload_2018-6-28_11-4-49.png

    and use trilib

    upload_2018-6-28_11-7-7.png

    how to fixed that?
     

    Attached Files:

  28. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    This issue should be fixed on the latest update. Have you updated TriLib from Asset Store?
     
  29. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi. I've answered you by e-mail and seems the file you're testing has additional data Assimp cannot read. I'll try to understand and implement this data myself or delegate it to my Assimp team partner.
     
  30. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Please send your file for testing to:
    contato@ricardoreis.net
     
  31. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi. I've never seen a MeshRenderer being disabled when importing a model directly in Unity. Is there a specific reason why it needs to be disabled? Also, what'ws the file format you're importing?
     
  32. MrDChristop

    MrDChristop

    Joined:
    Oct 26, 2016
    Posts:
    6
    Hi,
    I am using Unity 2017.3.1f1 and Trilib 1.8.4 on OSX
    I enable DevIL but model with bmp models do get loaded.
    You can test this also, just run the AssetLoading sample, and load the following cubes.
    One has jpg texture and shows up fine. The other has a bmp. Pictures attached.
    Screen Shot 2018-07-02 at 19.02.40.png Screen Shot 2018-07-02 at 19.02.55.png
    https://www.dropbox.com/s/2hzaf2h8k47fz9o/Crate.zip?dl=0
    Does OSX support DevIL and loading of the images DevIL supports?

    A relevant question
    How can i remove the question mark texture when no texture is found upon loading?I would prefer to not load anything instead of showing the question mark.

    Thanks
    Dimi
     
  33. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi. I will be testing your model soon.

    Best regards,
    Ricardo Reis.
     
  34. MrDChristop

    MrDChristop

    Joined:
    Oct 26, 2016
    Posts:
    6
    Hi this is just a reference model that displays the problem. I did the test on Win10 and the bmp textures Do show up. But on OSX the bmp texture does not load. I also used the trilibtest.zip viewers available on the site.
    On OSX DevIL must NOT be working.....


    How can i remove the question mark texture when no texture is found upon loading?I would prefer to not load anything instead of showing the question mark?
     
    Last edited: Jul 3, 2018
  35. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi. I would ask you to wait some days as I will replace DevIL by a newer and better licensed alternative which should work fine on any platform. About the question mark, I may create a patch to remove the blue question mark that is created by TriLib, but the red question mark is internal to Unity when it cannot find any appropriate loader for the texture.
     
    Christop likes this.
  36. universus

    universus

    Joined:
    Jan 20, 2015
    Posts:
    5
    Hi. i bought TriLib, when i test the model in the sample application it loads and when i run from the unity editor or from the build from unity it fails to load and give me this message:

    System.ArgumentException: An element with the same key already exists in the dictionary.
    at System.Collections.Generic.Dictionary`2[System.String,System.String].Add (System.String key, System.String value) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.BuildObjects (IntPtr scene, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.LoadInternal (IntPtr scene, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoaderBase.InternalLoadFromFile (System.String filename, TriLib.AssetLoaderOptions options) [0x00000] in <filename unknown>:0
    at TriLib.AssetLoader.LoadFromFile (System.String filename, TriLib.AssetLoaderOptions options, UnityEngine.GameObject wrapperGameObject) [0x00000] in <filename unknown>:0
    at TriLib.Samples.AssetLoaderWindow.<LoadLocalAssetButtonClick>m__0 (System.String filename) [0x00000] in <filename unknown>:0

    Can you help me with this thanks.
     
  37. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi. The latest TriLib update should fix this issue.
    Could you update your TriLib version and tell me if the issue persists?
     
  38. Christop

    Christop

    Joined:
    Aug 21, 2012
    Posts:
    60
    Thanks, please inform me. Can we expect something soon? have a look at freeimage i have used it in the past for many projects also on OSX.
     
  39. universus

    universus

    Joined:
    Jan 20, 2015
    Posts:
    5
    Hi, it gives me in Unity 2018 editor this message when i load the file:

    System.ArgumentException: An element with the same key already exists in the dictionary.
    at System.Collections.Generic.Dictionary`2[System.String,System.String].Add (System.String key, System.String value) [0x0007e] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x0005d] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:1442
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00107] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:1463
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00107] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:1463
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00107] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:1463
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00107] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:1463
    at TriLib.AssetLoaderBase.BuildObject (TriLib.NodeData parentNodeData, IntPtr node, TriLib.AssetLoaderOptions options) [0x00107] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:1463
    at TriLib.AssetLoaderBase.BuildObjects (IntPtr scene, TriLib.AssetLoaderOptions options) [0x0001d] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:1425
    at TriLib.AssetLoaderBase.LoadInternal (IntPtr scene, TriLib.AssetLoaderOptions options) [0x00106] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:1413
    at TriLib.AssetLoaderBase.InternalLoadFromFile (System.String filename, TriLib.AssetLoaderOptions options) [0x0004f] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:674
    at TriLib.AssetLoader.LoadFromFile (System.String filename, TriLib.AssetLoaderOptions options, UnityEngine.GameObject wrapperGameObject) [0x00004] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoader.cs:31
    at TriLib.Samples.AssetLoaderWindow.<LoadLocalAssetButtonClick>m__0 (System.String filename) [0x0002d] in F:\New Unity Project (7)\Assets\TriLib\TriLib\Samples\Scripts\AssetLoaderWindow.cs:175

    its strange because in the sample program trilib it loads the same file ok but when compiled in unity it dosent load.
     
  40. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    That's exactly the library I guess I'm going to implement. I don't have an ETA yet, as I'll have to test this native library on every TriLib platform, and that can take some time, but I'll definetly start the implementation this week.
     
    Christop likes this.
  41. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    The latest update from Asset Store should fix this issue.
    Have you downloaded the latest update?
     
  42. Christop

    Christop

    Joined:
    Aug 21, 2012
    Posts:
    60
    I assume you have confirmed that DevIL is not loading/working on OSX? Even when using it outside of Unity?
     
  43. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    It has been tested on OSX and was working fine on the latest test I've made. Anyway, I will redo all the tests with FreeImage when it has been implemented.
     
  44. universus

    universus

    Joined:
    Jan 20, 2015
    Posts:
    5
    I tested with the Asset store version and the one from the invoice from your site, even with the version 5.6.2 from unity it doesnt load. it only load with the Trilib sample application from your website that i think is from version of Unity 5.6.2.
    Have you compiled an application with an early version of Unity? I would like to use trilib to load big FBX files, some i tested loading them to bender application and then export them and they work but for bigger files this method is not a solution, i need to load them directly with trilib to unity. If you can help i would be appreciated.
     
  45. MrDChristop

    MrDChristop

    Joined:
    Oct 26, 2016
    Posts:
    6
    There is something not right here. Did the cube obj mode i send above with the bmp texture load up in your test? Really?
    In the Texture2DUtils.cs , in the ApplyTextureData() which is used for loading the textures the DevIL part is
    commented out with an #if statement for OSX..... It does not use the IlLoader, but the Unity LoadImage, which supports only png/jpg.

    Have a look yourself. Line143 in Texture2Dutlis.cs, in the ApplyTextureData() function you can clearly see that for OSX the DevIL is not used only for windows......
    Code (CSharp):
    1. #if (TRILIB_USE_DEVIL || USE_DEVIL) && (UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN)
    2.             return IlLoader.LoadTexture2DFromByteArray(data, data.Length, out tempTexture2D);
    3. #else
    4.             tempTexture2D = new Texture2D(2, 2, TextureFormat.RGBA32, true);
    5.             return tempTexture2D.LoadImage(data);
    6. #endif

    If you would add UNITY_STANDALONE_OSX (i just did ) the textures load up.
    Is there a reason you use DevIL loading only for windows?

    Please have a look, its important....


    Thanks
    Dimi
     
    Last edited: Jul 6, 2018
  46. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Your TriLib version is outdated. Please download the latest Beta version from:
    https://ricardoreis.net/?p=217

    Also, please make sure you make a clean TriLib install:
    https://ricardoreis.net/?p=282
     
    Last edited: Jul 6, 2018
  47. MrDChristop

    MrDChristop

    Joined:
    Oct 26, 2016
    Posts:
    6
    You are right i thought i had 1.8.4 but i had an older version. I can confirm that in 1.8.4 (current) and 1.8.5c (beta) the textures load up fine and DevIL is used.

    Can you add a place inside the Unity package (a text file or so, or in source) where the Trilib version is noted. There is no way to find the version after its added to a unity project.

    Thanks
    Dimi
     
  48. universus

    universus

    Joined:
    Jan 20, 2015
    Posts:
    5
    I tried the Beta and Current Versions and it gives me this error: System.ArgumentException: An element with the same key already exists in the dictionary.
    The only that loads the file is the AssetLoader Sample application from the website.
    I am tring to make a VR application to view models and im depending from loding the models with Unity so i need the application to work maybe??
    I tried a clean install to unity project and dont work. I even tried version 5.6.2 and it still dont compile and work like the sample AssetLoader application.
    I do not understand what it means the error System.ArgumentException: An element with the same key already exists in the dictionary. and the cause of it and how to repair it, need help if possible thanks.
     
  49. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    542
    Hi. Could you send the full error log to contato@ricardoreis.net?
     
  50. deadlyGolum

    deadlyGolum

    Joined:
    Dec 31, 2013
    Posts:
    8
    @rickomax

    Hi,
    Have you looked into 3D models loading freeze issue. I am using Trilib and found that while loading 3D model there is a freeze to the game. Is there any work around....

    i am using
    Code (CSharp):
    1. assetLoader.LoadFromFile(assetPath);
    to load the assets
     
unityunity