Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

TriLib - Model Loading Package

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

  1. sandro-ixt

    sandro-ixt

    Joined:
    May 2, 2019
    Posts:
    12
    Here is another crash:

    Code (csharp):
    1.  
    2. 0x00007FFEA89E5D0C (UnityPlayer) block_locate_free
    3. 0x00007FFEA89E6381 (UnityPlayer) tlsf_memalign
    4. 0x00007FFEA7122C53 (UnityPlayer) DynamicHeapAllocator::Allocate
    5. 0x00007FFEA7123378 (UnityPlayer) MemoryManager::Allocate
    6. 0x00007FFEA71226BD (UnityPlayer) operator new
    7. 0x00007FFEA87E1B13 (UnityPlayer) Mesh::Mesh
    8. 0x00007FFEA7527029 (UnityPlayer) BaseObjectInternal::NewObject<Mesh>
    9. 0x00007FFEA755FAC1 (UnityPlayer) MeshScripting::CreateMesh
    10. 0x00007FFEA6E92B4D (UnityPlayer) Mesh_CUSTOM_Internal_Create
    11. 0x00000219B9C6B8FA (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Mesh:Internal_Create (UnityEngine.Mesh)
    12. 0x00000219B9C6B82B (Mono JIT Code) [C:\build\output\unity\unity\Runtime\Export\Graphics\Mesh.bindings.cs:20] UnityEngine.Mesh:.ctor ()
    13. 0x0000021A539887E3 (Mono JIT Code) TriLibCore.Geometries.GeometryGroup:GenerateMesh (TriLibCore.AssetLoaderContext,UnityEngine.Matrix4x4[],System.Collections.Generic.IList`1<int>)
    14. 0x0000021A539870E1 (Mono JIT Code) [C:\Users\sandro\repos\iVP\Assets\1_Plugins\TriLib\TriLibCore\Scripts\AssetLoaders\AssetLoader.cs:964] TriLibCore.AssetLoader:ParseGeometry (TriLibCore.AssetLoaderContext,UnityEngine.GameObject,TriLibCore.Interfaces.IRootModel,TriLibCore.Interfaces.IModel)
    15. 0x0000021A53985FB3 (Mono JIT Code) [C:\Users\sandro\repos\iVP\Assets\1_Plugins\TriLib\TriLibCore\Scripts\AssetLoaders\AssetLoader.cs:807] TriLibCore.AssetLoader:ParseModel (TriLibCore.AssetLoaderContext,UnityEngine.Transform,TriLibCore.Interfaces.IRootModel,TriLibCore.Interfaces.IModel,bool)
    16. 0x0000021A539866AB (Mono JIT Code) [C:\Users\sandro\repos\iVP\Assets\1_Plugins\TriLib\TriLibCore\Scripts\AssetLoaders\AssetLoader.cs:837] TriLibCore.AssetLoader:ParseModel (TriLibCore.AssetLoaderContext,UnityEngine.Transform,TriLibCore.Interfaces.IRootModel,TriLibCore.Interfaces.IModel,bool)
    17. 0x0000021A53985943 (Mono JIT Code) [C:\Users\sandro\repos\iVP\Assets\1_Plugins\TriLib\TriLibCore\Scripts\AssetLoaders\AssetLoader.cs:453] TriLibCore.AssetLoader:ProcessModel (TriLibCore.AssetLoaderContext)
    18. 0x0000021A539857F3 (Mono JIT Code) [C:\Users\sandro\repos\iVP\Assets\1_Plugins\TriLib\TriLibCore\Scripts\AssetLoaders\AssetLoader.cs:1173] TriLibCore.AssetLoader:ProcessRootModel (TriLibCore.AssetLoaderContext)
    19. 0x0000021A5396829B (Mono JIT Code) TriLibCore.General.ContextualizedAction`1<T_REF>:Invoke ()
    20. 0x00000219B9E212E4 (Mono JIT Code) TriLibCore.Utils.Dispatcher:Update ()
    21. 0x00000219B9DF8BC8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    22. 0x00007FFEA652FB04 (mono-2.0-bdwgc) mono_jit_set_domain
    23. 0x00007FFEA646E7A4 (mono-2.0-bdwgc) mono_object_get_virtual_method
    24. 0x00007FFEA646E93C (mono-2.0-bdwgc) mono_runtime_invoke
    25. 0x00007FFEA7BC809D (UnityPlayer) scripting_method_invoke
    26. 0x00007FFEA7BAE7FC (UnityPlayer) ScriptingInvocation::Invoke
    27. 0x00007FFEA7BA0CC3 (UnityPlayer) MonoBehaviour::CallMethodIfAvailable
    28. 0x00007FFEA7BA0D9F (UnityPlayer) MonoBehaviour::CallUpdateMethod
    29. 0x00007FFEA73D07B0 (UnityPlayer) BaseBehaviourManager::CommonUpdate<BehaviourManager>
    30. 0x00007FFEA73D821D (UnityPlayer) BehaviourManager::Update
    31. 0x00007FFEA76F0EDE (UnityPlayer) `InitPlayerLoopCallbacks'::`2'::UpdateScriptRunBehaviourUpdateRegistrator::Forward
    32. 0x00007FFEA76DE30E (UnityPlayer) ExecutePlayerLoop
    33. 0x00007FFEA76DE3DF (UnityPlayer) ExecutePlayerLoop
    34. 0x00007FFEA76E23D2 (UnityPlayer) PlayerLoop
    35. 0x00007FFEA7C3FDAF (UnityPlayer) PerformMainLoop
    36. 0x00007FFEA7C3E97B (UnityPlayer) MainMessageLoop
    37. 0x00007FFEA7C435E9 (UnityPlayer) UnityMainImpl
    38. 0x00007FFEA7C4521B (UnityPlayer) UnityMain
    39. 0x00007FF789F311F2 (iVP Planning) __scrt_common_main_seh
    40. 0x00007FFFE33B26AD (KERNEL32) BaseThreadInitThunk
    41. 0x00007FFFE46CAA68 (ntdll) RtlUserThreadStart
    42.  
     
  2. sandro-ixt

    sandro-ixt

    Joined:
    May 2, 2019
    Posts:
    12
    I'm experiencing a similar issue, but on Windows. See the stack traces I've posted above. The first one is when loading a model multiple times. Seems like the application crashes when disposing the native array in the finalizer of AssetLoaderContext. Were you able to find a solution or workaround for this?
     
  3. javierFM95

    javierFM95

    Joined:
    Sep 1, 2023
    Posts:
    1
    hello, i am new in trilib and i have a problem. i am loading some models with a link that i get with firebase, the problem is that in windows the model is downloaded well but in mac os it can not be downloaded.
    here is the error that I get.
    error loading model: System.ArgumentNullException: Buffer cannot be null.
    parametre name: buffer
    at System.IO.MemoryStream..ctor (System.Byte[] buffer, System.Boolean writable) [0x00009] in <16d1a1e3fafa4d23a275526c945e1b62>:0
    at System.IO.MemoryStream..ctor (System.Byte[] buffer) [0x00000] in <16d1a1e3fafa4d23a275526c945e1b62>:0
    at (wrapper remoting-invoke-with-check) System.IO.MemoryStream..ctor(byte[])
    at TriLibCore.AssetDownloaderBehaviour+<DownloadAsset>d__3.MoveNext () [0x0008e] in /Users/yeltic/yeltic_App/Assets/TriLib/TriLibCore/Scripts/AssetLoaders/AssetDownloaderBehaviour.cs:50
    UnityEngine.Debug:Registro (objeto)
    InteractiveModel:OnError (TriLibCore.IContextualizedError) (en Assets/LeARn/Scripts/Contenidos_Scripts/3DTemplate/InteractiveModel.cs:172)
    TriLibCore.AssetDownloaderBehaviour/<DownloadAsset>d__3:MoveNext () (es Assets/TriLib/TriLibCore/Scripts/AssetLoaders/AssetDownloaderBehaviour.cs:88)
    UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr) (en /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/Coroutines.cs:17)
    i hope you can help me :)
     
  4. augment-it

    augment-it

    Joined:
    Jun 29, 2018
    Posts:
    4
    I am using trilib 2 version 2.2.0, and when i load model at runtime, the materials appear darker with fbx and glb models, not yet tested others, and i checked the main color, the base color is indeed different, anyone meet this problem?
     
  5. PortalVRit

    PortalVRit

    Joined:
    Oct 19, 2018
    Posts:
    11
    @rickomax seems that you stoped the upport for this product?
    I need to load the assets ina an async way and seems that trilib is not doing this also if there are code parts that seems to suggest that there is this implementation.

    it is possible to have an answer?
    thanks.
     
  6. ItsPixelFire

    ItsPixelFire

    Joined:
    Dec 15, 2021
    Posts:
    2
    I'm wanting to do the same thing. I emailed last week and haven't gotten a response yet.
    I just want to load a list of files all at once, one after the other. But I get missing object references, likely because my next file is loading before a previous file has finished.
    Need async/multiple file help @rickomax. Thanks!
     
  7. Clebosevic

    Clebosevic

    Joined:
    Mar 2, 2021
    Posts:
    3
    Hey everyone! When I try to load an ordinary OBJ-file with the "AssetLoaderFilePicker", the obj gets loaded, but the material and texture do not get set, and are set metallic.
    Is this a common issue, and am i forgetting something, or is my apporach wrong?
    Code (CSharp):
    1. // Lets the user load a new model by clicking a GUI button.
    2. private void myOwnFunc()
    3. {
    4.     // Creates an AssetLoaderOptions instance.
    5.     // AssetLoaderOptions is a class used to configure many aspects of the loading process.
    6.     // We won't change the default settings this time, so we can use the instance as it is.
    7.     var assetLoaderOptions = AssetLoader.CreateDefaultLoaderOptions();
    8.     assetLoaderOptions.LoadTexturesAsSRGB = false;
    9.  
    10.  
    11.     // Creates the AssetLoaderFilePicker instance.
    12.     // AssetLoaderFilePicker is a class that allows users to select models from the local file system.
    13.     var assetLoaderFilePicker = AssetLoaderFilePicker.Create();
    14.  
    15.     GameObject wrapper = new GameObject();
    16.  
    17.     // Shows the model selection file-picker.
    18.     assetLoaderFilePicker.LoadModelFromFilePickerAsync("Select a File",
    19.         OnLoad,
    20.         OnMaterialsLoad,
    21.         OnProgress,
    22.         OnBeginLoad,
    23.         OnError,
    24.         wrapper,
    25.         assetLoaderOptions);
    26. }
    I just want to load an ordinary OBJ file, why is that so hard in Unity? ^^ @rickomax
     
  8. augment-it

    augment-it

    Joined:
    Jun 29, 2018
    Posts:
    4
    Do you also have the mtl file together with obj in the same folder? Because the materials and textures are referenced inside mtl file.


     
  9. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    681
    Hey guys.
    I'm developing new systems and finding more people to help give TriLib proper support, so I apologize if I don't access the forums too often—lots of things are in the works.
    Cheers!
     
  10. ankitrajdwivedi01

    ankitrajdwivedi01

    Joined:
    Aug 29, 2023
    Posts:
    5
    Hi, I'm interested in this lib does it also provide support for export the model at run time in different format.
     
  11. Clebosevic

    Clebosevic

    Joined:
    Mar 2, 2021
    Posts:
    3
    I got the file to load, with the material and the texture, but it is super shiny and stuff, even though Blender, etc show it as matt ...
     
  12. XieAndWater

    XieAndWater

    Joined:
    Mar 18, 2022
    Posts:
    1
    Hello, I am currently using TriLib 2.2.0. When I load a Gltf 2.0 file, the material mapper has some issues. It maps materials that are not “Transparent” as “Transparent”. However, when I use other Gltf loading plugins like GltfUtility or GltFast, this issue does not occur.
     
  13. SceneForgeStudio

    SceneForgeStudio

    Joined:
    Feb 28, 2017
    Posts:
    467
    Hi! I just updated to the latest version, and now I'm unable to switch the SFB MacOS plugin to "Any CPU" to allow it to work on Apple Silicon. This worked in older versions of Trilib, but now I can only get it to work in builds on Intel MacOS Builds.

    Any help would be appreciated. Thanks!
     
  14. kael558

    kael558

    Joined:
    Sep 27, 2022
    Posts:
    1
    Hello,

    This package is awesome, however, I'm running into an issue with Animations. I'm loading a FBX file from Mixamo and extracting the animation clip as follows:

    upload_2023-11-3_11-32-18.png
    Then I'm attaching the animationClip to an override controller to run on another Avatar.

    But for some reason, the animationClip is still in "generic" format instead of "humanoid" format.

    Has anyone had any success with this?
     
  15. SceneForgeStudio

    SceneForgeStudio

    Joined:
    Feb 28, 2017
    Posts:
    467