Search Unity

TriLib - Model Loading Package

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

  1. DM00z

    DM00z

    Joined:
    Nov 13, 2013
    Posts:
    1
    Hello.
    I was able to load my FBX at runtime using Trilib, but embedded textures were not loaded.
    Note that when I import the FBX in editor, the textures are not automatically loaded and I have to click Extract Textures to save them to a folder then Unity loaded them on the model. I am using Unity 2020.3.18.
    I can provide the FBX in DM if needed.
    Thank you.
     
    Last edited: Oct 15, 2021
  2. Spark_Coder

    Spark_Coder

    Joined:
    Sep 17, 2017
    Posts:
    1
    Hi @rickomax,
    Love your work.
    Recently I've been trying to use TRILIB to load a few FBX files at runtime from a remote server and the sub meshes' pivot seem to shifting to the center of the whole object. Kindly look into the issue so that more of your users can be happy with your product.
     
  3. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    TriLib should load embedded textures just fine, as long as they are using one of the supported file formats (jpg, png, tga, bmp, psd or gif).

    If you prefer, send me the model to: contato@ricardoreis.net
     
  4. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    You could try changing the static FBXReader.PivotMode field value and see if it works for you.
    If not, please send me a model you're trying to load to: contato@ricardoreis.net so I can check it out.
     
  5. pr90s

    pr90s

    Joined:
    Oct 26, 2018
    Posts:
    5
    Hi @rickomax

    I've been using Trilib to load FBX files at runtime. I'm getting an error while loading the FBX file.
    Note that the FBX model which I am using is generated in Unity at runtime.
    Any idea why I am getting this error?

    "An error occurred while loading your Model: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <695d1cc93cca45069c528c15c9fdd749>:0
    at TriLibCore.Geometries.GeometryGroup`1[TVertexData].GenerateMesh (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.Matrix4x4[] bindPoses) [0x000c7] in <38628f71b2a24dd897bd250e9cf3714c>:0
    at TriLibCore.AssetLoader.ParseGeometry (TriLibCore.AssetLoaderContext assetLoaderContext, UnityEngine.GameObject meshGameObject, TriLibCore.Interfaces.IRootModel rootModel, TriLibCore.Interfaces.IModel meshModel) [0x00012] "

     
    Last edited: Oct 18, 2021
    simonejennings likes this.
  6. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    Could you send me the model for testing to: contato@ricardoreis.net?
     
  7. MrYellow03

    MrYellow03

    Joined:
    Jun 10, 2021
    Posts:
    1
    Hello @rickomax,

    I'm currently using Trilib version 1.9 and I'm having a hard time loading an object with textures. At first, I tried the assetLoader.LoadFromMemory function and it shows the object without its textures. Now, I'm trying the assetLoader.LoadFromMemoryWithTextures function and can't get it to work. I keep getting errors. The doc on this function is not helping me either. What should I put in these properties: fileData, assetExtension, wrapperGameObject?

    Also, what do you mean when you say "Accept ZIP files"?

    Thank you for your help!
     
  8. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Please use the following snippet (replacing the URLs by the ones you want to load):
    Code (CSharp):
    1. using TriLibCore.Utils;
    2. using UnityEngine;
    3.  
    4. namespace TriLibCore.Samples
    5. {
    6.     /// <summary>
    7.     /// This sample loads chained (consecutively) models from different URLs.
    8.     /// </summary>
    9.     public class ChainedURLDownloadSample : MonoBehaviour
    10.     {
    11.         // Original Models: https://github.com/jaanga/3d-models
    12.         /// <summary>
    13.         /// Contains the list of models to be downloaded.
    14.         /// </summary>
    15.         public string[] URLs = new string[]
    16.         {
    17.             "https://ricardoreis.net/trilib/demos/sample/a-330.obj",
    18.             "https://ricardoreis.net/trilib/demos/sample/factory-complex.obj",
    19.             "https://ricardoreis.net/trilib/demos/sample/villa-savoye.zip",
    20.         };
    21.  
    22.         /// <summary>
    23.         /// Contains the Asset Loader Options to use when loading the models.
    24.         /// You can leave this field empty, so TriLib will create the Asset Loader Options automatically with default values.
    25.         /// </summary>
    26.         public AssetLoaderOptions AssetLoaderOptions;
    27.  
    28.         /// <summary>
    29.         /// Contains the GameObject that will be the parent to the loaded models.
    30.         /// You can leave this field empty, so GameObjects will be created on the scene root level.
    31.         /// </summary>
    32.         public GameObject WrapperGameObject;
    33.  
    34.         /// <summary>
    35.         /// Represents the index to the URLs array from the model that is currently downloading.
    36.         /// </summary>
    37.         private int _urlIndex;
    38.  
    39.         /// <summary>
    40.         /// Assigns the default Asset Loader Options in case no one is assigned, then proceeds to load the first model.
    41.         /// </summary>
    42.         private void Start()
    43.         {
    44.             AssetLoaderOptions = AssetLoaderOptions ?? AssetLoader.CreateDefaultLoaderOptions();
    45.             DownloadNextModel();
    46.         }
    47.  
    48.         /// <summary>
    49.         /// Downloads the next model in the URL list and advances the model URL index counter.
    50.         /// </summary>
    51.         private void DownloadNextModel()
    52.         {
    53.             if (_urlIndex >= URLs.Length)
    54.             {
    55.                 return;
    56.             }
    57.             var url = URLs[_urlIndex++];
    58.             var fileExtension = FileUtils.GetFileExtension(url, false);
    59.             var webRequest = AssetDownloader.CreateWebRequest(url);
    60.             AssetDownloader.LoadModelFromUri(webRequest, OnLoad, OnMaterialsLoad, OnProgress, OnError, WrapperGameObject, AssetLoaderOptions, null, fileExtension);
    61.             Debug.Log($"Begin downloading:{URLs[_urlIndex - 1]}");
    62.         }
    63.  
    64.         /// <summary>
    65.         /// This method is called when there was any error while loading the current model,
    66.         /// it then displays the error that was generating while loading the model and advances to the next model loading.
    67.         /// </summary>
    68.         /// <param name="contextualizedError"></param>
    69.         private void OnError(IContextualizedError contextualizedError)
    70.         {
    71.             Debug.LogError($"There was an error downloading:{URLs[_urlIndex - 1]}");
    72.             Debug.LogError(contextualizedError.GetInnerException());
    73.             DownloadNextModel();
    74.         }
    75.  
    76.         /// <summary>
    77.         /// You can track the model loading progress in this method.
    78.         /// </summary>
    79.         private void OnProgress(AssetLoaderContext assetLoaderContext, float progress)
    80.         {
    81.  
    82.         }
    83.  
    84.         /// <summary>
    85.         /// This method is called when the model has loaded, but may still have resources to load.
    86.         /// </summary>
    87.         private void OnLoad(AssetLoaderContext assetLoaderContext)
    88.         {
    89.          
    90.         }
    91.  
    92.         /// <summary>
    93.         /// This method is called when the model is successfully loaded, it then tries to load the next model loading.
    94.         /// You can access the loaded GameObject with the assetLoaderContext.RootGameObject field.
    95.         /// </summary>
    96.         private void OnMaterialsLoad(AssetLoaderContext assetLoaderContext)
    97.         {
    98.             Debug.Log($"Successfully downloaded:{URLs[_urlIndex - 1]}");
    99.             DownloadNextModel();
    100.         }
    101.     }
    102. }
     
    pr90s likes this.
  9. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    I will check it out.
    There is a long time I don't use TriLib 1.9x.
     
    MrYellow03 likes this.
  10. pr90s

    pr90s

    Joined:
    Oct 26, 2018
    Posts:
    5
    Thanks @rickomax
     
  11. ArjanBroosSioux

    ArjanBroosSioux

    Joined:
    Jun 1, 2021
    Posts:
    17
    I'm using Trilib 2.1.2 and if I cancel 8 ongoing model loads, I always get 8 of the following errors:
    "NullReferenceException: Object reference not set to an instance of an object.
    TriLibCore.Utils.Dispatcher.Update () (at <38628f71b2a24dd897bd250e9cf3714c>:0)"

    Some context:
    Code (CSharp):
    1. public void Reset()
    2. {
    3.     ...
    4.     foreach (var context in contexts)
    5.     {
    6.         context.CancellationTokenSource.Cancel();
    7.     }
    8.     contexts.Clear();
    9. }
    10.  
    11. private void StartMeshLoad()
    12. {
    13.     ...
    14.     Action<IContextualizedError> onError = error =>
    15.     {
    16.         if (error.Context.CancellationToken.IsCancellationRequested)
    17.         {
    18.             Debug.Log($"Cancellation was requested for: {path}");
    19.         }
    20.         else
    21.         {
    22.             Debug.LogError($"Error while loading {path}: {error}");
    23.         }
    24.     };
    25.  
    26.     var context = AssetLoader.LoadModelFromFile(path, null, onLoaded, null, onError, parent.gameObject, options);
    27.     contexts.Add(context);
    28. }
    29.  
    Any idea what could be going wrong here?
     
  12. simonejennings

    simonejennings

    Joined:
    Jan 11, 2017
    Posts:
    13
    Hi,

    I've been getting "Index was outside the bounds of the array." as the message OnError for the occasional model.
    At first I thought it was just 1 faulty model but I've got it again since then.
    The strange part is it seems to happen only on Standalone, we have an android project and a WebGL project with the exact same setup that are loading these same models perfectly fine.

    Any Idea if there's something I've missed in setup, or something I can do to make this work?

    Thanks :)
     
  13. devCts

    devCts

    Joined:
    Oct 28, 2021
    Posts:
    1
    Hi,
    Love your asset, works like a charm, except for one wierd thing. On UWP (Hololens2) when a model has 5 or more materials the materials fail to load. If the model has animation, the animation loads and plays fine, accessible through our scipts, can be stopped, paused, played, but they get the default white material. If it has no animation, the app freezes, debug.log logs "Model load 66.67%", VS debugger throws an exception, which is not very helpful:

    VS debugger:
    // System.Boolean UnityEngine.Texture2D::Internal_CreateImpl(UnityEngine.Texture2D,System.Int32,System.Int32,System.Int32,UnityEngine.Experimental.Rendering.GraphicsFormat,UnityEngine.Experimental.Rendering.TextureCreationFlags,System.IntPtr)
    IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Texture2D_Internal_CreateImpl_m48CD1B0F76E8671515956DFA43329604E29EB7B3 (Texture2D_t9B604D0D8E28032123641A7E7338FA872E2698BF * ___mono0, int32_t ___w1, int32_t ___h2, int32_t ___mipCount3, int32_t ___format4, int32_t ___flags5, intptr_t ___nativeTex6, const RuntimeMethod* method)
    {
    typedef bool (*Texture2D_Internal_CreateImpl_m48CD1B0F76E8671515956DFA43329604E29EB7B3_ftn) (Texture2D_t9B604D0D8E28032123641A7E7338FA872E2698BF *, int32_t, int32_t, int32_t, int32_t, int32_t, intptr_t);
    static Texture2D_Internal_CreateImpl_m48CD1B0F76E8671515956DFA43329604E29EB7B3_ftn _il2cpp_icall_func;
    if (!_il2cpp_icall_func)
    _il2cpp_icall_func = (Texture2D_Internal_CreateImpl_m48CD1B0F76E8671515956DFA43329604E29EB7B3_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Texture2D::Internal_CreateImpl(UnityEngine.Texture2D,System.Int32,System.Int32,System.Int32,UnityEngine.Experimental.Rendering.GraphicsFormat,UnityEngine.Experimental.Rendering.TextureCreationFlags,System.IntPtr)");
    bool icallRetVal = _il2cpp_icall_func(___mono0, ___w1, ___h2, ___mipCount3, ___format4, ___flags5, ___nativeTex6);
    return icallRetVal;
    }

    ------------------end of VS debugger
    ___nativeTex6 is an __int64 value=0
    ___flags5 is an __int value=1
     
  14. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    I will check it out.
     
  15. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!
    I've fixed some index issues in my working version. It is possible that the upcoming update will fix your issues as well. I'm planning to release it next week.
     
    simonejennings likes this.
  16. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!
    I don't have the device to test it right now. I'm just starting to research how the Hololens 2 development works (what are the tools I need to test it without the device). But looks like this issue has something to do with memory usage. Maybe the Hololens 2 does not have enough memory to process TriLib textures. This is a point I'm slowly improving as well, trying to reduce the memory footprint.
     
  17. ArjanBroosSioux

    ArjanBroosSioux

    Joined:
    Jun 1, 2021
    Posts:
    17
    Hey, I found out that it was my own misuse. The error.Context was null.
    I changed:
    Code (CSharp):
    1. if (error.Context.CancellationToken.IsCancellationRequested)
    into:
    Code (CSharp):
    1. if (error.GetInnerException() is OperationCanceledException)
    .

    Now it works as expected.
     
  18. magglemitch

    magglemitch

    Joined:
    Dec 8, 2013
    Posts:
    112
    Hi - I'm having a weird problem where the hierarchy of an obj model is different when imported in the editor vs imported on a build (using webGL). Is there anything simple that I may have missed that would cause this difference?
     
  19. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!
    This is not meant to happen.
    Could you send the model you're trying to load to contato@ricardoreis.net?
     
  20. magglemitch

    magglemitch

    Joined:
    Dec 8, 2013
    Posts:
    112
    Cool have emailed you.
     
  21. magglemitch

    magglemitch

    Joined:
    Dec 8, 2013
    Posts:
    112
    I've tried many different Unity versions but no luck sorting this issue as of yet. Has anyone else had any similar results using WebGL? All other platforms seem consistent.
     
  22. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    I'm having a weird issue where only in builds, some models imported with Trilib will become all white from certain angles (with ambient occlusion). I assume it's a shader issue, but from my understanding, Trilib uses all standard shaders. Not sure why!
    I'm using URP, and this happens with most models regardless of type (MeshRenderer/SkinnedRenderer). Tested with both a Mixamo model (seen in image) and others. Doesn't happen to all objects though (Spider-man works fine, in this example).

    Any help would be greatly appreciated because this is causing a lot of trouble for my users :(



    I also would like to know more about Zip file support. It would be amazing to download a gltf file from sketchfab (which comes in a zip by default) and just select that, but that doesn't work right now from my testing.

    Thanks so much!
     
    Last edited: Nov 14, 2021
  23. Jimbo_Slice

    Jimbo_Slice

    Joined:
    Oct 1, 2015
    Posts:
    44
    Hi Ricardo,

    We are encountering a problem with loading some textures since we upgraded from 2.0.14b to 2.1.2 where some textures are not loading on a model that had no issues loading in the previous version we were using. I am using the AssetViewer sample scene LoadModelFromFile button and getting no errors/warnings. Also noticing that the textures are displaying much darker/more saturated than the previous TriLib version we used (not as big an issue, but don't know if it is somehow connected or both are a byproduct of some changes TriLib texture pipeline changes between the 2 versions.).


    Character is in FBX format with embedded materials/textures. I tried importing via traditional Unity Editor and the missing textures exist and are readable/uncorrupted.

    Not sure if any other users have experienced this or you have any pointers to help troubleshoot?
     
  24. karonte

    karonte

    Joined:
    Jun 2, 2013
    Posts:
    48
    Hi guys! i have a big question/problem. I bought the asset because i need a good importer for 3d models in a WEBGL project. Did someone use it online? i found some issue because i see that the importer ( i used a zip file with fbx inside) loads correctly only the FIRST time. If i try to load the model another time ( forgive optimizations i want to load the model 2 times or more) it gives me error in the browser consolle. I cannot fine a good webgl model importer :(.
     
  25. excelremontka

    excelremontka

    Joined:
    Apr 18, 2020
    Posts:
    12
    Hey guys. Please tell me Why Android does not load textures when loading obj models? They load normally in the editor. what settings to set for the platform?
     
  26. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    I've answered you by e-mail.
     
  27. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!
    Regarding the URP issue, if you provide me a model by email, I could check it out.
    Regarding Zip support, if you're downloading it using WebGL, the server you download from needs the cross-domain downloading restriction disabled.
     
  28. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!
    Could you send me the model for testing? (contato@ricardoreis.net)
    I'm about to send a new update to Asset Store that could fix this issue.
    Also, looks like you're using the Unity builtin texture loader, that does not have support to some formats TriLib uses. You can disable the Unity builtin texture loader at the: Edit->Settings->TriLib menu.
     
  29. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!
    What are the errors you're getting in the console? (Please make sure you have enabled the full stack-trace and deploying a development build, so we can check what is going on)
     
  30. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!
    Android file picker requires you to select all model dependency files (textures and other resources), as it is emulating the file-system and TriLib won't be able to find these files if you don't select them. A better/simpler option is using Zip files only.
     
  31. JudahMantell

    JudahMantell

    Joined:
    Feb 28, 2017
    Posts:
    476
    I'll email you a repro project with a model that this happens to. Thanks!
     
  32. simonejennings

    simonejennings

    Joined:
    Jan 11, 2017
    Posts:
    13
    Hi!
    Any updates on when this new version with the potential fixes will come out?

    I've also lately been having some issue with some files (they seem to all be .obj) that don't throw any error but just won't load at all. Very strange as its not all .obj files, and I can't identify whats different about the ones that won't load.

    Thanks
     
  33. Jimbo_Slice

    Jimbo_Slice

    Joined:
    Oct 1, 2015
    Posts:
    44
    Thanks for your response! I just emailed you there.

    FYI, we tried the Trilib texture loader as well as the Unity Built-in texture loader during our troubleshooting - it just so happened that I took the screengrabs during the Unity attempt. Import was troublesome with both loaders.
     
  34. ArjanBroosSioux

    ArjanBroosSioux

    Joined:
    Jun 1, 2021
    Posts:
    17
    When I use the editor, or a player built with the editor, everything loads and shows fine.
    However, when I build a player from command line, nothing loaded by TriLib2 shows.
    The logging indicates that loading went fine.
    Any models known by Unity at build time do show.

    Any idea what could cause this and how I could fix this?

    Build script:
    Code (CSharp):
    1. var options = new BuildPlayerOptions
    2. {
    3.     scenes = new[] { "Assets/Scenes/Arena.unity" },
    4.     locationPathName = $"{targetDirectory}/Application.exe",
    5.     target = BuildTarget.StandaloneWindows64,
    6.     options = BuildOptions.None
    7. };
    8. BuildReport report = BuildPipeline.BuildPlayer(options);
     
  35. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    973
    Hi,
    I have updated fom 2.1.2 to the 2.1.3b.

    I have problems with some fbx models that got loaded with 2.1.2 version, and do not get loaded with 2.1.3b.

    These fbx models break the Android app and generate memory limit error on WebGL.
    This is a Texture loading problem, because these models load only with GenerateMipmaps disabled and No Compression selected on AssetLoadingOptions.

    I have sent you a link to one these problematic fbx models by e-mail.

    Could you suggest me a fix to this?
    Or could I access the 2.1.2 archive so I could move back to the old version?
     
    Last edited: Dec 7, 2021
  36. karonte

    karonte

    Joined:
    Jun 2, 2013
    Posts:
    48
    I upgraded my trilib2. I know you correct some bugs but now my 3d objects names were changed. We created a sort of "code" in the 3d name of our models so that I can recognize them inside unity. So I can have 2 or mode objects with the same name ( code). Why did you change this? we need to have codes inside the name and it's common to give objects the same name!
     
  37. bkleck

    bkleck

    Joined:
    Aug 19, 2021
    Posts:
    3
    Hi, great library so far, was able to get it to work on MacOS and Windows. However, when I built it on IOS and ran it on an iPad, I experienced this issue:

    "A scripted object (script unknown or not yet loaded) has a different serialization layout when loading. (Read 52 bytes but expected 56 bytes).

    Any idea how I go about solving it? I followed the example FileLoader code on the TriLib site, and the error seems to come from either MaterialMapper or AssetLoader.

    upload_2021-12-9_16-30-42.png
     
  38. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Have you tried out 2.1.3b?
    There is a hotfix to be released soon.
     
  39. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    I will send a patch to Asset Store today that has some important texture fixes.
     
  40. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    I will test the command-line builder again, but the last time I've checked out, it was working fine
     
  41. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    Textures processing consumes a lot of memory. You could try disabling the ForcePowerOfTwoTextures Loader Option, that should prevent TriLib from recreating textures that are not power-of-two in resolution
     
  42. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    The version on Asset Store has some object renaming issues. I'm sending a patch today. Objects with the same name have to be renamed, otherwise, Animation Clips can't reference them, and in-editor importing can't save assets. I can add an Asset Loader Option to disable this feature, but that will break compatibility with the above scenarios.
     
  43. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    I would recommend backing up your project, deleting TriLib contents and reimporting TriLib (2.1.3b)
     
  44. polygonfuture

    polygonfuture

    Joined:
    Feb 4, 2016
    Posts:
    20
    Hi @rickomax Having an issue with your library on Quest 2 (Android)

    I am getting ton of log messages during the load process:

    Code (CSharp):
    1. Cannot find object with id:140372319354560
    2. UnityEngine.Debug:Log (object)
    3. TriLibCore.Fbx.FBXProcessor:ProcessConnections (TriLibCore.Fbx.FBXNode)
    4. TriLibCore.Fbx.FBXProcessor:Process (TriLibCore.Fbx.FBXNode,bool)
    5. TriLibCore.Fbx.Reader.FbxReader:ParseBinary (System.IO.Stream)
    6. TriLibCore.Fbx.Reader.FbxReader:ReadStream (System.IO.Stream,TriLibCore.AssetLoaderContext,string,System.Action`2<TriLibCore.AssetLoaderContext, single>)
    7. TriLibCore.AssetLoader:LoadModel (TriLibCore.AssetLoaderContext) (at Assets/TriLib/TriLibCore/Scripts/AssetLoader.cs:1039)
    8. TriLibCore.General.ContextualizedAction`1<TriLibCore.AssetLoaderContext>:Invoke ()
    9. TriLibCore.Utils.ThreadUtils/<>c__DisplayClass0_0`1<TriLibCore.AssetLoaderContext>:<RunThread>b__0 ()
    10. System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

    These messages spam the console. There are probably at least 100-200 that occur during load process.
    Im running Trilib on a quest 2 and it has very minimal resources. These could become memory issues for the quest.

    Do you have any guidance on what is causing these issues? Double clicking the error takes me to this part of the library:

    Line 1039 in AssetLoader.cs

    assetLoaderContext.RootModel = reader.ReadStream(fileStream, assetLoaderContext, assetLoaderContext.Filename, assetLoaderContext.OnProgress);



    Additionally I am only loading to get the animation data out of the asset. I have turned off load mesh, materials, and textures in order to optimize due to quest. The model is only around 5 - 9 mb in size and it is an FBX.

    I am using Unity 2021.01.10f and Trilib 2.1.1
     
    Last edited: Dec 17, 2021
  45. polygonfuture

    polygonfuture

    Joined:
    Feb 4, 2016
    Posts:
    20
    @rickomax In addition to the post above, it looks like your domain just expired today 12/17/2021. It has taken down your web site / wiki. Looks like it just happened, btw.
     
  46. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Important: Hey guys. I'm aware of the domain issue. The company where I bought the domain is dead (I've just discovered it). I'm trying to contact them to have things sorted out as fast as possible.

    For more info, please follow me on Twitter:
    Ricardo Reis (@realrickomax) / Twitter
     
    Last edited: Dec 18, 2021
    polygonfuture likes this.
  47. giovannowarli

    giovannowarli

    Joined:
    Apr 2, 2020
    Posts:
    3
    Hi! Thank you for such a useful asset! I'm wondering if it is possible to get the file data (file size) and the file as raw (fbx, obj, etc.)? I'm creating a 3D viewer checker where you can check the 3d model before uploading to s3 thru unity webgl.
     
  48. SFXMartinTuor

    SFXMartinTuor

    Joined:
    Mar 25, 2017
    Posts:
    4
    Hi! We recently updated TriLib from 2.1.2 to 2.1.3.
    Unfortunately, this new version now gives us an error we hadn't before during the loading process of an FBX file:

    Code (CSharp):
    1. An error occurred while loading your Model: System.OverflowException: Value was either too large or too small for an Int32.
    2.   at System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00057] in <9577ac7a62ef43179789031239ba8798>:0
    3.   at System.Int32.Parse (System.String s) [0x00007] in <9577ac7a62ef43179789031239ba8798>:0
    4.   at TriLibCore.ReaderBase.EnsureUniqueName[T] (TriLibCore.Interfaces.IObject sourceObject, System.Collections.Generic.IList`1[T] objects, System.Collections.Generic.Dictionary`2[TKey,TValue] names) [0x00049] in <a7ee3af2cca246488fbe71636d737316>:0
    5.   at TriLibCore.ReaderBase.PostProcessModel (TriLibCore.Interfaces.IRootModel model) [0x00134] in <a7ee3af2cca246488fbe71636d737316>:0
    6.   at TriLibCore.Fbx.Reader.FbxReader.ReadStream (System.IO.Stream stream, TriLibCore.AssetLoaderContext assetLoaderContext, System.String filename, System.Action`2[T1,T2] onProgress) [0x0001c] in <a51e88b1f393483cb8bf0a17900989f1>:0
    7.   at TriLibCore.AssetLoader.LoadModel (TriLibCore.AssetLoaderContext assetLoaderContext) [0x00110] in D:\%AnonymusFolderName%\Assets\TriLib\TriLibCore\Scripts\AssetLoader.cs:984
    8.   at TriLibCore.General.ContextualizedAction`1[T].Invoke () [0x00000] in <a7ee3af2cca246488fbe71636d737316>:0
    9.   at TriLibCore.Utils.ThreadUtils+<>c__DisplayClass0_0`1[T].<RequestNewThreadFor>b__0 () [0x0002f] in <a7ee3af2cca246488fbe71636d737316>:0
    Is there a workaround without being forced to downgrade?

    Platform: Windows 10
    Unity-Version: Unity 2019.4.19f1

    Thank you in advance.
     
  49. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
  50. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    Could you send me the model you're trying to load to contato@ricardoreis.net?