Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

TriLib - Model Loading Package

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

  1. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Hi!

    Are you using the latest update? (1.9.0)

    Best regards,
    Ricardo Reis.
     
  2. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    For anyone having issues with TriLib 1.9.0, I strongly recommend giving a try on TriLib 2.0.
    I'm focusing on fixing all 1x common issues on this version.
    There will be a few more updates to the 1x version until 2.0 doesn't is stable enough.

    Existing users can get their beta at:
    https://ricardoreis.net/?p=217

    Just keep in mind TriLib 1x and 2.0 code isn't compatible, but I will probably build come up with an adapter layer for TriLib 2.0 later (to use existing TriLib 1x code).

    Only FBX and OBJ loaders are available at the moment, but more loaders are on the works (GLTF and DAE).
     
  3. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hey...
    I just switched from v1.9 to 2.0beta and I run into a few problems.

    It seems that I can't use AssetLoaderOptions anymore:
    Code (CSharp):
    1. _assetLoaderOptions = new AssetLoaderOptions();
    2. _assetLoaderOptions.UseFileScale = true;
    lead to this
    Code (CSharp):
    1. TriLibCore.General.ContextualizedError: A contextualized error has occurred. ---> System.ArgumentNullException: Value cannot be null.
    2. Parameter name: array
    3.   at System.Array.Sort[T] (T[] array, System.Comparison`1[T] comparison) [0x00003] in <ac823e2bb42b41bda67924a45a0173c3>:0
    4.   at TriLibCore.AssetLoader+<>c__DisplayClass0_0.<LoadModelFromFile>b__0 (System.Object context) [0x00008] in .../Assets/TriLibCore/Scripts/AssetLoader.cs:57
    5.   at TriLibCore.General.ContextualizedAction.Invoke () [0x00000] in <563c52fb442d4c7893f15d4eb081f2a6>:0
    6.   at TriLibCore.Utils.ThreadUtils+<>c__DisplayClass0_0`1[T].<RunThread>b__0 () [0x00002] in .../Assets/TriLibCore/Scripts/Utils/ThreadUtils.cs:50
    7.    --- End of inner exception stack trace ---
    8. 0   Unity                               0x000000010196b18c _Z13GetStacktracei + 92
    9. 1   Unity                               0x0000000100186d1b _Z17DebugStringToFileRK21DebugStringToFileData + 795
    10. 2   Unity                               0x0000000101ddc45b _ZN15DebugLogHandler12Internal_LogE7LogTypeN4core12basic_stringIcNS1_20StringStorageDefaultIcEEEEP6Object + 331
    11. 3   Unity                               0x0000000101ddc21a _Z35DebugLogHandler_CUSTOM_Internal_Log7LogTypeP10MonoStringP10MonoObject + 330
    12. 4  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    Another problem is that my Models are mirrored on Z after import and the option UseOriginalPositionRotationAndScale does not seem to exist anymore.

    One other thing is that using an OnProgress(float progress) method in LoadModelFromFile() never gets triggered!? Not sure why!?

    Regards
     
    Last edited: Nov 14, 2019
  4. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    The default AssetLoaderOptions will already use the original file scale.

    To create an AssetLoaderOptions, use "ScriptableObject.CreateInstance<AssetLoaderOptions>".

    I've just updated the beta with progress handling:

    https://ricardoreis.net/?p=217

    Please tell me if it works for you.
     
    smartinetz likes this.
  5. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hey...
    the new update worked as far as the progress call, however, using your suggestion to create a new instance of a scriptable object did not.

    I tried...
    Code (CSharp):
    1. _assetLoaderOptions = ScriptableObject.CreateInstance<AssetLoaderOptions>();
    2. _assetLoaderOptions.UseFileScale = true;
    and ended up with the same error...
    Code (CSharp):
    1. TriLibCore.General.ContextualizedError: A contextualized error has occurred. ---> System.ArgumentNullException: Value cannot be null.
    2. Parameter name: array
    3.   at System.Array.Sort[T] (T[] array, System.Comparison`1[T] comparison) [0x00003] in <ac823e2bb42b41bda67924a45a0173c3>:0
    4.   at TriLibCore.AssetLoader+<>c__DisplayClass0_0.<LoadModelFromFile>b__0 (System.Object context) [0x00008] in ...Assets/TriLibCore/Scripts/AssetLoader.cs:57
    5.   at TriLibCore.General.ContextualizedAction.Invoke () [0x00000] in <2f7de25b9a5f4e83aa211e93f572e61e>:0
    6.   at TriLibCore.Utils.ThreadUtils+<>c__DisplayClass0_0`1[T].<RunThread>b__0 () [0x00002] in .../Assets/TriLibCore/Scripts/Utils/ThreadUtils.cs:50
    7.    --- End of inner exception stack trace ---
    8. 0   Unity                               0x000000010196b18c _Z13GetStacktracei + 92
    9. 1   Unity                               0x0000000100186d1b _Z17DebugStringToFileRK21DebugStringToFileData + 795
    10. 2   Unity                               0x0000000101ddc45b _ZN15DebugLogHandler12Internal_LogE7LogTypeN4core12basic_stringIcNS1_20StringStorageDefaultIcEEEEP6Object + 331
    11. 3   Unity                               0x0000000101ddc21a _Z35DebugLogHandler_CUSTOM_Internal_Log7LogTypeP10MonoStringP10MonoObject + 330
    12. 4  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    Oh and the file scale wasn't the problem for me but the objects are mirrored after loading which I find odd.

    Regards
     
  6. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Hi!

    Regarding the flipped model, I would have to check the model.

    Looks like your AssetLoaderOptions.MaterialMappers field is empty.
    Could you download the update again and make sure the "StandardDiffuseMaterialMapper" is assigned into your AssetLoaderOptions.MaterialMappers field?

    upload_2019-11-14_14-15-19.png

    Best regards,
    Ricardo Reis.
     
    smartinetz likes this.
  7. niksasaw

    niksasaw

    Joined:
    Mar 3, 2017
    Posts:
    8
    Hi, we are getting the following errors after importing in unity 2019.2.6 any suggestions, Thanks

    Assets/TriLib/TriLib/Editor/TriLibAssetEditor.cs(621,28): error CS1061: 'AssetImporter' does not contain a definition for 'SaveAndReimport' and no accessible extension method 'SaveAndReimport' accepting a first argument of type 'AssetImporter' could be found (are you missing a using directive or an assembly reference?)

    Assets/TriLib/TriLib/Editor/TriLibAssetEditor.cs(97,44): error CS0117: 'AssetImporter' does not contain a definition for 'GetAtPath'

    Assets/TriLib/TriLib/Editor/TriLibAssetEditor.cs(98,43): error CS1061: 'AssetImporter' does not contain a definition for 'userData' and no accessible extension method 'userData' accepting a first argument of type 'AssetImporter' could be found (are you missing a using directive or an assembly reference?)
     
  8. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Gonna fix it right now.
     
  9. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Ricardo,

    I attached the Model for you to look at.

    As far as AssetLoadOptions, I got those working now, even though nothing in there helped me with the flipped model problem :(

    One more thing I would like to know (or to add)..
    Currently the progress in LoadModelFromFile() only coveres the loading in general. But I have a large model with 280+ verts that loads quickly but then needs at least 5 seconds to prepare and show it (so it seems). Do you think there is a way to add that extra time to the progress float as well? That way I could inform my users with a progress bar or window.

    Regards
     

    Attached Files:

  10. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hey Ricardo..

    here is some more feedback to the latest version..

    I've been testing some of my models (using your Example scene!) and the worse thing I noticed is the overall performance decrease (about 90%, compared to 1.8.x) with some of my models.

    Here are some of the models I tested...

    Regards
     

    Attached Files:

  11. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Hey!

    TriLib 1x has many parts written in C++, which increases the performance, but I've been working hard to make TriLib 2 performance better.
     
    smartinetz likes this.
  12. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    I've already fixed the flipped coordinates bug on my working version. I'm profiling the libraries to check out why the performance issues with OBJ files.
     
    smartinetz likes this.
  13. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hey...
    that sounds great!
    I downgraded back to 1.9.0 for now but ran into the next problem regarding the smoothness of imported materials :(
    Screenshot 2019-11-15 at 15.01.16.png

    All materials receive a smoothness amount of 7.5 after the import!!!
    Screenshot 2019-11-15 at 15.02.06.png

    Any idea how to fix/patch this?

    Regards

    EDIT:

    Found the method in the class AssimInterop where the 7.5 gets assigned. Still no idea how to patch/fix this though.

    Code (CSharp):
    1. public static bool aiMaterial_GetShininess(IntPtr ptrMat, out float floatOut)
    2.         {
    3.             floatOut = 0f;
    4.             var buffer = LockGc(floatOut);
    5.             var result = _aiMaterial_GetShininess(ptrMat, buffer.AddrOfPinnedObject());
    6.             var floatBuffer = new float[1];
    7.             Marshal.Copy(buffer.AddrOfPinnedObject(), floatBuffer, 0, 1);
    8.             floatOut = floatBuffer[0] / 100f;
    9.             buffer.Free();
    10.             return result;
    11.         }
     
    Last edited: Nov 15, 2019
  14. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    One more thing about the models I sent that increase the loading time so much...
    All of those models have NO material. The models I tried with a material have acceptable loading times though.
    Maybe that gets you somewhere!? ;)

    Regards
     
  15. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    I have updated the beta package with the coordinate fixes and a bit improvement on speed. I'm still to figure out why the model you sent is taking so long.
     
    smartinetz likes this.
  16. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    @rickomax

    I'm trying to get the URL to the model when downloading to match it to the database the url is stored in to pair it with data....can you tell me what object holds the url?

    And how can I keep the model in the scene without it getting destroyed?
     
  17. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Fixed the performance issues. Please re-download the beta package.
     
    smartinetz likes this.
  18. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Bravo!!
    Performance is great and the progress issue, where the model was loaded but still interpreted in the background, seems to be fixed as well!

    Great job Ricardo!!

    I have one more issue with a few models that load perfect in the older versions (1.8.x+). The models seem broken in the new version and will only be loaded partly!? :( I attach them here for you to have a look.

    EDIT: I fixed the issue triangulating the models and cleaning them up. Funny enough they did work ok in the old version. Maybe something you should explain a little more in the documentation later on. ;)

    Regards
     

    Attached Files:

    Last edited: Nov 18, 2019
  19. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Tesselation issues. Already fixed. Please re-download the beta package.
     
    smartinetz likes this.
  20. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    2.0 Update: fixed some mesh issues and added experimental ASCII STL support.
     
    smartinetz likes this.
  21. chrpetry

    chrpetry

    Joined:
    Mar 7, 2018
    Posts:
    65
    Great news that you are working on this!
    I'll wait until the finished 2.0 version is ready before switching. Gotta keep a stable FBX import running and currently don't have the time to experiment.
    Once the version is final, I can update on my topic.

    Best regards
    Christian
     
  22. Malley13

    Malley13

    Joined:
    Jul 15, 2018
    Posts:
    5
    Good Day
    I am having some issues with android once the project is built it doesn't ask for permissions on my phone anymore and it won't find any models on the phone.
     
  23. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Hi!

    Are you using AssetDownloader.cs?

    Best regards,
    Ricardo Reis.
     
  24. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    Yes, But It's hard for me to wrap my head around it. I'm on the right track though. I'll call on you if I need help.

    I have my models downloading via zip and works well. But when downloading another the first one disappears.

    Trying to access it once it is downloaded.
     
  25. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    I'm almost there... I am using the "AssetDownloader" and going by the example scene when you can download the model it has a "JSHelper" file that references the a function in the "assetdownloadwindow" file....but I don't want all that stuff and I can't strip it all with out effecting the rest.
     
  26. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    I have it downloading...but still having problems accessing the "rootNode" to add colliders and I can't download another model without overwriting the existing one.
     
  27. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hey @rickomax,

    I am still testing the new version and on iOS I get this error sometimes. Any idea whats happening here?

    Code (CSharp):
    1. UnityEngine.Object.Internal_CloneSingle (UnityEngine.Object data) (at <00000000000000000000000000000000>:0)
    2. UnityEngine.Object.Instantiate[T] (T original) (at <00000000000000000000000000000000>:0)
    3. TriLibCore.Mappers.StandardMaterialMapper.InstantiateMaterial (TriLibCore.Interfaces.IMaterial material) (at <00000000000000000000000000000000>:0)
    4. TriLibCore.Mappers.StandardDiffuseMaterialMapper.Map (TriLibCore.AssetLoaderContext assetLoaderContext, TriLibCore.Interfaces.IMaterial material, System.Action`4[T1,T2,T3,T4] textureLoadCallback) (at <00000000000000000000000000000000>:0)
    5. TriLibCore.AssetLoader.ParseGeometry (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.GameObject parentGameObject, TriLibCore.Interfaces.IModel model) (at <00000000000000000000000000000000>:0)
    6. TriLibCore.AssetLoader.ParseModel (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.Transform parentTransform, TriLibCore.Interfaces.IModel model) (at <00000000000000000000000000000000>:0)
    7. TriLibCore.AssetLoader.ParseModel (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.Transform parentTransform, TriLibCore.Interfaces.IModel model) (at <00000000000000000000000000000000>:0)
    8. TriLibCore.AssetLoader.ProcessModel (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.GameObject wrapperGameObject) (at <00000000000000000000000000000000>:0)
    9. TriLibCore.AssetLoader+<>c__DisplayClass0_0.<LoadModelFromFile>b__1 (System.Object context) (at <00000000000000000000000000000000>:0)
    10. System.Action`1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0)
    11. TriLibCore.General.ContextualizedAction.Invoke () (at <00000000000000000000000000000000>:0)
    12. TriLibCore.Utils.Dispatcher.Update () (at <00000000000000000000000000000000>:0)
    Regards
     
    Last edited: Nov 22, 2019
  28. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
  29. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Like this...

    Code (CSharp):
    1.     private static AssetLoaderOptions CreateLoaderOptions()
    2.     {
    3.         var assetLoaderOptions = ScriptableObject.CreateInstance<AssetLoaderOptions>();
    4.         assetLoaderOptions.UseFileScale = true;
    5.         assetLoaderOptions.MaterialMappers = new MaterialMapper[]
    6.         {
    7.             Resources.Load<StandardDiffuseMaterialMapper>("StandardDiffuseMaterialMapper")
    8.         };
    9.         return assetLoaderOptions;
    10.     }
     
  30. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    Do I put this in the assetDownloader? Or can I put it anywhere?
     
  31. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    You could place it for instance like this....

    Code (CSharp):
    1. private void LoadModelAsync(string filename)
    2.     {
    3.         try
    4.         {
    5.             _loading = true;
    6.  
    7.             AssetLoader.LoadModelFromFile(filename, OnLoad, OnTexturesLoad, OnProgress, OnError,
    8.                                           gameObject, CreateLoaderOptions(), null);
    9.         }
    10.         catch (Exception e)
    11.         {
    12.             _loading = false;
    13.         }
    14.     }
    Check the example Ricardo has put together.. it's pretty much all in there
     
  32. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    The examples are way too convoluted for me. Even your response is vague to me.

    Does it go in the "assetDownloader"? Or anywhere?
     
  33. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    And then where does the options appear? and when? I see nothing.
     
  34. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    If I try downloading a second model it is placed in the root of the first model that downloaded.
     
  35. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    @rickomax

    This is my only hang up. How can I do this?
     
  36. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    I plan on putting this on Daqri and HoloLens devices. So can I still Serialize it? Can I store the Serialized file in a folder in the assets folder?
     
  37. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hey @rickomax ...

    heres a list of problems I discovered with the beta...

    1. The unsolved error I described in my previous post:
    Code (CSharp):
    1. UnityEngine.Object.Internal_CloneSingle (UnityEngine.Object data) (at <00000000000000000000000000000000>:0)
    2. UnityEngine.Object.Instantiate[T] (T original) (at <00000000000000000000000000000000>:0)
    3. TriLibCore.Mappers.StandardMaterialMapper.InstantiateMaterial (TriLibCore.Interfaces.IMaterial material) (at <00000000000000000000000000000000>:0)
    4. TriLibCore.Mappers.StandardDiffuseMaterialMapper.Map (TriLibCore.AssetLoaderContext assetLoaderContext, TriLibCore.Interfaces.IMaterial material, System.Action`4[T1,T2,T3,T4] textureLoadCallback) (at <00000000000000000000000000000000>:0)
    5. TriLibCore.AssetLoader.ParseGeometry (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.GameObject parentGameObject, TriLibCore.Interfaces.IModel model) (at <00000000000000000000000000000000>:0)
    6. TriLibCore.AssetLoader.ParseModel (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.Transform parentTransform, TriLibCore.Interfaces.IModel model) (at <00000000000000000000000000000000>:0)
    7. TriLibCore.AssetLoader.ParseModel (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.Transform parentTransform, TriLibCore.Interfaces.IModel model) (at <00000000000000000000000000000000>:0)
    8. TriLibCore.AssetLoader.ProcessModel (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.GameObject wrapperGameObject) (at <00000000000000000000000000000000>:0)
    9. TriLibCore.AssetLoader+<>c__DisplayClass0_0.<LoadModelFromFile>b__1 (System.Object context) (at <00000000000000000000000000000000>:0)
    10. System.Action`1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0)
    11. TriLibCore.General.ContextualizedAction.Invoke () (at <00000000000000000000000000000000>:0)
    12. TriLibCore.Utils.Dispatcher.Update () (at <00000000000000000000000000000000>:0)
    2. A contextualized error I get alot when loading models directly from device (iPad) but sometimes even in editor. As far as I know "sharing violations" can occur if you try to read a file that is currently written. Any idea what's going on and how I can prevent this from happing?
    Code (CSharp):
    1. TriLibCore.General.ContextualizedError: A contextualized error has occurred. ---> System.IO.IOException: Sharing violation on path /var/mobile/Containers/Data/Application/5250CA7B-6169-45BC-812B-8410507CAA31/Documents/AnimationObjects/ra51705185_bottom.obj at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00000] in <00000000000000000000000000000000>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode) [0x00000] in <00000000000000000000000000000000>:0 at TriLibCore.AssetLoader+<>c__DisplayClass0_0.<LoadModelFromFile>b__0 (System.Object context) [0x00000] in <00000000000000000000000000000000>:0 at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at TriLibCore.General.ContextualizedAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at TriLibCore.Utils.Threa
    3. If I load a model with an image map, and load a seond one using the same image map, only the last model gets the image assigned. Not sure why...

    Regards
     
  38. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528

    @smartinetz

    I'm getting this error:

    Code (CSharp):
    1. Assets\TriLib\TriLib\Scripts\AssetLoader\AssetDownloader.cs(167,54): error CS0246: The type or namespace name 'MaterialMapper' could not be found (are you missing a using directive or an assembly reference?)
     
  39. xxyxxyz

    xxyxxyz

    Joined:
    Jan 26, 2017
    Posts:
    5
    Hi, I am having an issue where Unity crashes when loading several models at the same time via AssetLoaderAsync. This is the code resulting in the error:

    Code (CSharp):
    1. private IEnumerator ProcessQueuedFiles()
    2. {
    3.     while (true)
    4.     {
    5.         lock (mUpdateLock)
    6.         {
    7.             while (mAvailableLoaders.Count != 0 && mFilesToBeLoaded.Count != 0)
    8.             {
    9.                 var loader = mAvailableLoaders.Dequeue();
    10.                 var file = mFilesToBeLoaded.Dequeue();
    11.  
    12.                 mRunningLoaders.Add(loader);
    13.                 mFilesBeingLoaded.Add(file);
    14.  
    15.                 loader.LoadFromFile(file, mFileLoaderOptions, new GameObject(), delegate (GameObject obj)
    16.                 {
    17.                     lock (mUpdateLock)
    18.                     {
    19.                         if (!mDirectoryObjects.TryGetValue(file, out var objects))
    20.                         {
    21.                             objects = new List<ObjectData>();
    22.                             mDirectoryObjects.Add(file, objects);
    23.                         }
    24.  
    25.                         mFilesBeingLoaded.Remove(file);
    26.                         mRunningLoaders.Remove(loader);
    27.                         mAvailableLoaders.Enqueue(loader);
    28.                     }
    29.                 });
    30.             }
    31.         }
    32.  
    33.         yield return new WaitForSeconds(1.5f);
    34.     }
    35. }
    The stack trace and crash info can be found here: https://pastebin.com/J5N8FCqb
     
  40. EdgarSantos

    EdgarSantos

    Joined:
    Nov 11, 2013
    Posts:
    27
    Hi,

    Great plugin, congrats :)

    I'm currently using it load ifc models (editor time and runtime) on Hololens and it works just fine (after some minor changes in the ifdef'd UWP sections to fix compiler issues and also library metadata)

    I'm very interested in loading the ifc metadata as well. I took a look at your code and you have an event that we can subscribe to that returns it BUT the data is garbage. Is there a way to do this properly?

    The use case is: map each geometry node to the proper IFCType.

    Thank your for your time!
     
  41. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Hi!

    Could you send your model for testing? (contato@ricardoreis.net)
    I've fixed this file concurrency issue, but maybe I've missed something...
     
    smartinetz likes this.
  42. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Hi!

    Can you check if all DLLs inside "TriLibCore/Plugins" folder are enabled on "All Platforms"?
     
    Last edited: Nov 22, 2019
  43. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    Hi!

    Could you paste a sample "garbage data" you got here?
     
  44. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    In all the plug in folders or just the windows folder? Or should they all be for all platforms?

    I looked in the assetLoaderOptions file and these material wrappers are not in there.
     
    Last edited: Nov 22, 2019
  45. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    TriLibCore (TriLib 2) has only a single Plugins folder. Are you mixing TriLib 1x with 2?
     
  46. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    No I haven't updated it yet. How do I update it after downloading it?
     
  47. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    There is no update, TriLib 1x and 2 aren't compatible.

    I would suggest you to look at the "AssetLoaderTest.cs" file on TriLib 2x package (https://ricardoreis.net/?p=217) to check the usage and peform the manual update of your code, which shouldn't be difficult.

    If you need any help upgrading your code, please post here.
     
  48. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    Do I delete the trilib folder and then import the new package?
     
  49. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    I am downloading the models. That scene is for local isn't it?
     
  50. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    687
    It is, but it's easy to load from UnityWebRequest, I will setup a sample