Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TriLib - Model Loading Package

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

  1. Tofu-Huang

    Tofu-Huang

    Joined:
    Aug 25, 2015
    Posts:
    7
    2017.4.30
    i fix the issue by set the alpha channel values to red channel.
     
  2. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    Just giving feedback on the next TriLib update:

    I've moved all menu items from TriLib menu to the Project Settings TriLib are and added a few more options to:
    -Disable automatic models importing on the editor (which can cause some overhead when the project have many custom models).
    -Disable checking for native-plugins (which can be disabled safely when TriLib is extracted for the first time and no native-plugins are deleted later).
    -Disable checking for older TriLib versions.

    There is a button now on the Project Settings called "Configure Native Plugins". When clicked, TriLib will configure all native plugins (assimp.dll, libassimp.so, stb_image.dll, lib_stbimage.so and so on) automatically, so this will ensure the right native plugins will be included in your builds.

    The TriLib install path can be changed safely now, as there are some new methods to automatically detect where it's installed, allowing Editor samples may work with any install path.

    TrILib now remaps common material properties automatically when using the High Definition Render Pipeline.

    I'm preparing a sample of the raw materia propertiesl loading, which can be useful when implementing PBR materials, etc.

    I'm also updating the Assimp version with the master branch changes, so this update may take one week or more to be ready.
     
  3. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Hi, most of my fbxes are loaded mirrored on Z axis (left and right are changed). It's serious problem and it's not fbxes fault as they load just fine with standard Unity importer and also other software.
     
  4. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    I'll investigate it.

    Best regards,
    Ricardo Reis.
     
  5. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I import a model with some objects that share the same material with:
    assetLoaderOptions.CombineMeshes = true;

    But I still get separate objects, why?
     
  6. amit-chai

    amit-chai

    Joined:
    Jul 2, 2012
    Posts:
    80
    Hi, is there another way to import models from PC running WebGL instead of dragging them into the browser? like pointing the file and path on the pc?
     
  7. Chopium

    Chopium

    Joined:
    Jun 15, 2015
    Posts:
    19
    It seems that compiling through IL2CPP with minifiy (proguard) enabled will strip common libraries, including android permissions and Trilib's assimp. I tried compiling with minify disabled and it seems to work. This video shows the ability to exclude certain libraries from being stripped. I'm out of time for now but maybe someone can figure out how to specify trilib's libraries in a user proguard file.
     
  8. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Because your model has blend-shapes and TriLib 1.0 can't merge blend-shaped meshes yet (as Unity CombineMesh method doesn't works with blend-shapes).
    Best regards,
    Ricardo Reis.
     
  9. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Yes, I'll try to provide a sample as soon as possible, meanwhile you can take a look at the source of TriLib WebGL Template:
    https://ricardoreis.net/trilib/WebGLTemplate.zip

    The "trilibHelper.js" file on the template has the "triLibAddFile" method which can be used to add files to TriLib using the file name and file data as a Uint8Array as parameters. Before adding files, the "triLibResetFiles" method should be called.

    Best regards,
    RIcardo Reis.
     
  10. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Thank you for your feedback. I will take a look.

    Best regards,
    Ricardo Reis.
     
  11. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    look001 and amit-chai like this.
  12. amit-chai

    amit-chai

    Joined:
    Jul 2, 2012
    Posts:
    80
    Hi Thanks for your response! I am not sure what and how to pass for the Uint8Array... can you please explain?
     
  13. deanryanvr2019

    deanryanvr2019

    Joined:
    Apr 12, 2019
    Posts:
    15
    the results are the same for AssetLoaderOptions.UseOriginalPositionRotationAndScale = true
    and AssetLoaderOptions.UseOriginalPositionRotationAndScale = false

    This issue is not fixed in beta version
     
  14. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hi Ricardo,

    I get these two exceptions after publishing to my iOS device:

    Code (CSharp):
    1. NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code.
    2.   at TriLib.AssimpInterop._aiImportFileEx (System.String filename, System.UInt32 flags, System.IntPtr ptrFS, System.IntPtr ptrProps, TriLib.AssimpInterop+ProgressCallback progressCallback) [0x00000] in <00000000000000000000000000000000>:0
    3.   at TriLib.AssimpInterop.ai_ImportFileEx (System.String filename, System.UInt32 flags, System.IntPtr ptrFS, System.IntPtr ptrProp, TriLib.AssimpInterop+ProgressCallback progressCallback) [0x00000] in <00000000000000000000000000000000>:0
    4.   at TriLib.AssetLoaderBase.ImportFile (System.String filename, TriLib.AssetLoaderOptions options, TriLib.AssimpInterop+ProgressCallback progressCallback) [0x00000] in <00000000000000000000000000000000>:0
    5.   at TriLib.AssetLoaderBase.InternalLoadFromFile (System.String filename, System.String basePath, TriLib.AssetLoaderOptions options, System.Boolean usesWrapperGameObject, TriLib.AssimpInterop+ProgressCallback progressCallback) [0x00000] in <00000000000000000000000000000000>:0
    6.   at TriLib.AssetLoaderAsync+<>c__DisplayClass0_0.<LoadFromFile>b__0 () [0x00000] in <00000000000000000000000000000000>:0
    7.   at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    8.   at TriLib.ThreadUtils+<>c__DisplayClass0_0.<RunThread>b__0 () [0x00000] in <00000000000000000000000000000000>:0
    9.   at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    10.   at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    11.   at System.Threading.ContextCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    12.   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    13.   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    14.   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    15.   at System.Threading.ThreadHelper.ThreadStart () [0x00000] in <00000000000000000000000000000000>:0
    16.   at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    Code (CSharp):
    1. Rethrow as Exception: Error parsing file: /var/mobile/Containers/Data/Application/F494AE91-A74C-45E1-98FE-40E172F22541/Documents/AnimationObjects/ra51705185_bottom.obj
    2.   at TriLib.AssetLoaderBase.InternalLoadFromFile (System.String filename, System.String basePath, TriLib.AssetLoaderOptions options, System.Boolean usesWrapperGameObject, TriLib.AssimpInterop+ProgressCallback progressCallback) [0x00000] in <00000000000000000000000000000000>:0
    3.   at TriLib.AssetLoaderAsync+<>c__DisplayClass0_0.<LoadFromFile>b__0 () [0x00000] in <00000000000000000000000000000000>:0
    4.   at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    5.   at TriLib.ThreadUtils+<>c__DisplayClass0_0.<RunThread>b__0 () [0x00000] in <00000000000000000000000000000000>:0
    6.   at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    7.   at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    8.   at System.Threading.ContextCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    9.   at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    10.   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
    11.   at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    12.   at System.Threading.ThreadHelper.ThreadStart () [0x00000] in <00000000000000000000000000000000>:0
    13.   at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    14. (Filename: currently not available on il2cpp Line: -1)
    The exception "Error parsing file" also shows on all other files I try to load. All objects do work great on your WebGL Demo btw. I already searched this thread for an anwer but without success. :(

    Any ideas?

    Regards
     
  15. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Spoke to soon! After the next build the errors are back. Even though it's working fine in OSX Editor! I am very certain it must have something to do with the plugins or the way they are packed into the Xcode project.

    All I get is...
    Code (CSharp):
    1. NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code.
    Code (CSharp):
    1. Rethrow as Exception: Error parsing file: /var/mobile/Containers/Data/Application/0F550B63-D4BD-4F14-B5EE-17C60686D52E/Documents/AnimationObjects/XMC01-05_20180529.obj
    Maybe I should also mention that I tried deleting and reimporting TriLib already without any success.
     
    Last edited: Sep 26, 2019
  16. Arcan-Studios

    Arcan-Studios

    Joined:
    Mar 12, 2015
    Posts:
    58
    cant get to work in webgl work perfect in editor, i update the plugin, and make a new fresh project only one scene and one model and try to load in runtime from StreamingAssets and the app run but no model load, the browser get this error
    Exception: Error loading asset. Assimp returns: [Unable to open file "https://www.arcanstudios.com/testeo/StreamingAssets/modelosCuerpos/01_2.fbx".] UnityLoader.js:4:9388
    at TriLib.AssetLoaderBase.InternalLoadFromFile (System.String filename, System.String basePath, TriLib.AssetLoaderOptions options, System.Boolean usesWrapperGameObject, TriLib.AssimpInterop+ProgressCallback progressCallback) [0x00000] in <00000000000000000000000000000000>:0

    this is the link
    https://www.arcanstudios.com/testeo/index.html

    i can send the project if needed, please i need help with this, its for a job
    thanks
     
  17. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    If you take a look at the TriLib WebGL Template (https://ricardoreis.net/trilib/WebGLTemplate.zip), you'll see the code that transforms the file data blob into a Uint8Array on the FileReader.onloadend event:

    Code (JavaScript):
    1. document.ondrop = function(e) {
    2.         e.stopPropagation();
    3.         e.preventDefault();
    4.         var files = e.dataTransfer.files;
    5.         window.triLibResetFiles(files.length);
    6.         for (var i = 0; i < files.length; i++) {
    7.           var file = files[i];
    8.           var fileReader = new FileReader();
    9.           fileReader.filename = file.name;
    10.           fileReader.onloadend = function(e) {
    11.             window.triLibAddFile(this.filename, new Uint8Array(e.target.result));
    12.           };
    13.           fileReader.readAsArrayBuffer(file);
    14.         }
    Any "ArrayBuffer" can be converted into a "Uint8Array".
     
  18. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    I wonder if you could wait for TriLib 2.0. I'm working hard to fix issues on version 2.0 and I'm almost sure the issues related to objects orientation/scale are already fixed. I'm planning to release a beta version in the next 45 days. Just keep in mind that TriLib 2.0 won't accept all file formats the 1x version does at the moment, it will be released with only the most used file formats support (FBX, DAE, OBJ, 3DS, and DXF).

    I will release a last update for TriLib 1x yet.

    Best regards,
    Ricardo Reis.
     
  19. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Yes, you can send the project to: contato@ricardoreis.net

    Best regards,
    Ricardo Reis.
     
  20. Arcan-Studios

    Arcan-Studios

    Joined:
    Mar 12, 2015
    Posts:
    58
    thanks, i send by wetransfer
     
  21. gulanxiu

    gulanxiu

    Joined:
    Mar 4, 2014
    Posts:
    14
    Looking forward to version 2.0:)
     
  22. Arcan-Studios

    Arcan-Studios

    Joined:
    Mar 12, 2015
    Posts:
    58
    the we transfer file i send, its near to expire
     
  23. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    I've already downloade your project.
     
  24. raymondtsang_amvr

    raymondtsang_amvr

    Joined:
    Feb 26, 2019
    Posts:
    6
    Hi all, I have bought this plugin for a while and it is very easy to use with UnityEditor and PC standalone build.
    However, I have tried more than a day for an android build but not succeeded yet...-_-
    Any one can give me a nice example to start with ??
    My task is to load a .fbx file locally (I can load it via URI with the sample scene - Scene1 - Asset Loader)
    My target devices are Samsung Tab S4 and Oculus Quest.
     
  25. deanryanvr2019

    deanryanvr2019

    Joined:
    Apr 12, 2019
    Posts:
    15
    Ok when is version 2 coming out , becuase this is a big issue at the moment

    I am using a FBX file

    thanks
     
  26. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    What's your Android device model?
     
  27. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    I guess that in the next one/two weeks I should have a beta out.
     
  28. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    I have a question. After we import a model during runtime it will stores that model somewhere inside a game folder? I mean If I close and restart the game should I import that model again?
     
    Last edited: Oct 6, 2019
  29. Arcan-Studios

    Arcan-Studios

    Joined:
    Mar 12, 2015
    Posts:
    58
    any news about the webgl load problem? thanks
     
  30. raymondtsang_amvr

    raymondtsang_amvr

    Joined:
    Feb 26, 2019
    Posts:
    6
    My target devices are Samsung Tab S4 and Oculus Quest.
     
  31. Arcan-Studios

    Arcan-Studios

    Joined:
    Mar 12, 2015
    Posts:
    58
    hi there, please i need a response with the webgl load problem, i make the project for a client already pay for this, and now reclaim me, and i have no answer for him, its fixeable? its not i need to buy another plugin, its yes how long to wait? i ask for suppor 2 week ago, its a very simple case, load fbx from compiled webgl app, please i need a solution, my client its begin nervous. thanks
     
  32. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    No, the model won't be stored on a new place automatically.

    You could serialize your loaded GameObject after loading it with TriLib and save it with a custom format, one of the benefits of doing so is that you would get faster loading times.

    There are some open-source projects to help you doing that:
    https://github.com/TeamSirenix/odin-serializer
    https://github.com/Mcklem/JSONGameObject

    Otherwise, you would have to reload the original model everytime you want to use it on runtime.

    Best regards,
    Ricardo Reis.
     
  33. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    Not yet. But I guess I'll release a TriLib 2.0 beta on next two weeks, which works on WebGL out-of-the-box. The initial version will work with FBX and OBJ files only. More formats will be implemented in the future.

    Best regards,
    Ricardo Reis.
     
  34. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    TriLib 2.0 beta should came out soon, which should fix the WebGL issues. The initial version will work with FBX and OBJ files only. More formats will be implemented in the future.

    If you still use any other format, I'm still talking with Unity team to fix the WebGL issue on current version.

    Best regards,
    Ricardo Reis.
     
  35. Edmund-Dev

    Edmund-Dev

    Joined:
    Oct 15, 2019
    Posts:
    9
    Hi,

    I'm currently using 1.8.9b and the function to retrieving unit scale factor from FBX models in your example
    Code (CSharp):
    1. var unitScaleFactor = 100f; //Sets scale factor default value.
    2.                 assetLoader.OnMetadataProcessed += delegate (AssimpMetadataType metadataType, uint metadataIndex, string metadataKey, object metadataValue)
    3.                 {
    4.                     //Checks if the metadata key is "UnitScaleFactor", which is the scale factor metadata used in FBX files.
    5.                     if (metadataKey == "UnitScaleFactor")
    6.                     {
    7.                         unitScaleFactor = (float)metadataValue; //Sets the scale factor value.
    8.                     }
    9.                 }; //Sets a callback to process model metadata.
    returns an error: InvalidCastException: Specified cast is not valid on
    unitScaleFactor = (float)metadataValue; //Sets the scale factor value.


    Any fix on this?

    Platform: UWP
    Device: Hololens
    Architecture: x86
    Model imported at runtime: 1 metre x 1 metre Cube made in Maya
     
    Last edited: Oct 16, 2019
  36. raymondtsang_amvr

    raymondtsang_amvr

    Joined:
    Feb 26, 2019
    Posts:
    6
    I just fixed it by using this

    unitScaleFactor = Convert.ToSingle(metadataValue); //Sets the scale factor value.
     
  37. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Sorry about the delay!

    I was going to suggest exactly that.

    Best regards,
    Ricardo Reis.
     
  38. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Hi, any update on the issue?
     
  39. deanryanvr2019

    deanryanvr2019

    Joined:
    Apr 12, 2019
    Posts:
    15
    Hello ,

    Any update on the beta version being released

    Thanks
     
  40. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hi ... I have an issue that I can't resolve on iOS 12+. When I try to load any of my models async, the app crashes with this error:

    Code (CSharp):
    1. Native Crash - Assimp::ObjFileImporter::createTopology(Assimp::ObjFile::Model const*, Assimp::ObjFile::Object const*, unsigned int)
    I tried to debug this in Xcode already but without any luck.

    Here's the stacktrace:
    Code (CSharp):
    1. Thread 68 (crashed)
    2. 0   xtendmobilear                      0x0000000105dd4bc0 Assimp::ObjFileImporter::createTopology(Assimp::ObjFile::Model const*, Assimp::ObjFile::Object const*, unsigned int)
    3. 1   xtendmobilear                      0x0000000105dd3a3c Assimp::ObjFileImporter::createNodes(Assimp::ObjFile::Model const*, Assimp::ObjFile::Object const*, aiNode*, aiScene*, std::__1::vector<aiMesh*, std::__1::allocator<aiMesh*> >&)
    4. 2   xtendmobilear                      0x0000000105dd2c1c Assimp::ObjFileImporter::CreateDataFromImport(Assimp::ObjFile::Model const*, aiScene*)
    5. 3   xtendmobilear                      0x0000000105dd2414 Assimp::ObjFileImporter::InternReadFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, aiScene*, Assimp::IOSystem*)
    6. 4   xtendmobilear                      0x0000000105af2158 Assimp::BaseImporter::ReadFile(Assimp::Importer const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Assimp::IOSystem*)
    7. 5   xtendmobilear                      0x0000000105b0e7f4 Assimp::Importer::ReadFile(char const*, unsigned int)
    8. 6   xtendmobilear                      0x0000000105ae2ab8 aiImportFileExWithProperties
    9. 7   xtendmobilear                      0x000000010674042c AssimpInterop__aiImportFileEx_m934F46B697E7439C0E40154C5A38BB0CAD4B9229
    10. 8   xtendmobilear                      0x0000000106725ba8 AssimpInterop_ai_ImportFileEx_m0BCB81279D091DBA8013BB0E603FDD1995501CD3
    11. 9   xtendmobilear                      0x000000010671904c AssetLoaderBase_ImportFile_m71437E6CA4CB6312B7C1F273CB2D74CC27469FB8
    12. 10  xtendmobilear                      0x000000010670f248 AssetLoaderBase_InternalLoadFromFile_m3F006428A7FA8B84EB2B0354F09E2019B330C055
    13. 11  xtendmobilear                      0x00000001067129d4 U3CU3Ec__DisplayClass0_0_U3CLoadFromFileU3Eb__0_m5B46E5D5B48821DBC9380A681F78F5ADD5766B6D
    14. 12  xtendmobilear                      0x0000000107b22fc0 Action_Invoke_mC8D676E5DDF967EC5D23DD0E96FB52AA499817FD
    15. 13  xtendmobilear                      0x0000000106766a48 U3CU3Ec__DisplayClass0_0_U3CRunThreadU3Eb__0_m56B0279AC69B1D35B5E72C9378D5A321EBF0AA3C
    16. 14  xtendmobilear                      0x0000000107d10cec ThreadStart_Invoke_m11B6A66E82F02C74399A7314C14C7F52393CC4B4
    17. 15  xtendmobilear                      0x0000000107d108b0 ThreadHelper_ThreadStart_Context_mE293651E7B7060DAC2F7FA75B354BF206DA774A6
    18. 16  xtendmobilear                      0x0000000107ce6b40 ContextCallback_Invoke_m76E65E7A67AA99858554F451E0F78E22B6478998
    19. 17  xtendmobilear                      0x0000000107ce9624 ExecutionContext_RunInternal_m5BF955CE8B04D9A7C959B9011579CC0FABD5FC56
    20. 18  xtendmobilear                      0x0000000107ce9154 ExecutionContext_Run_mFF76DDA6501D993EB4A4B79EFDAF1F6476920945
    21. 19  xtendmobilear                      0x0000000107ce19b0 ExecutionContext_Run_m97152E1791C019905F6297946D7411CA6683CCEB
    22. 20  xtendmobilear                      0x0000000107d10ff0 ThreadHelper_ThreadStart_m8CB657ADE8F96ED7949120D441D40F2A23EECBD2
    23. 21  xtendmobilear                      0x0000000107d10cec ThreadStart_Invoke_m11B6A66E82F02C74399A7314C14C7F52393CC4B4
    24. 22  xtendmobilear                      0x0000000104f13100 RuntimeInvoker_TrueVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017(void (*)(), MethodInfo const*, void*, void**)
    25. 23  xtendmobilear                      0x0000000105a3e1ac il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)
    26. 24  xtendmobilear                      0x0000000105a0eec0 il2cpp::icalls::mscorlib::System::Threading::ThreadStart(void*)
    27. 25  xtendmobilear                      0x0000000105a17924 il2cpp::os::Thread::RunWrapper(void*)
    28. 26  xtendmobilear                      0x0000000105a1937c il2cpp::os::ThreadImpl::ThreadStartWrapper(void*)
    29. 27  libsystem_pthread.dylib            0x00000001a8597d5c _pthread_start
    30. 28  (Mono)                                                Mono JIT frame
    Please help, it's urgent!
    Regards
     
  41. Edmund-Dev

    Edmund-Dev

    Joined:
    Oct 15, 2019
    Posts:
    9
    Hi again, I'm receiving this error when I attempt to load any models from my persistent data path on the Hololens. Any idea on how to fix this issue from the GetExtensionList function?

    Platform: UWP
    Device: Hololens
    Architecture: x86
    Model imported at runtime: 1 metre x 1 metre Cube made in Maya
    Scripting Backend: .Net
    Trilib Ver: 1.8.9b
    Unity Ver: 2018.4.01f


    DllNotFoundException: Unable to load DLL 'assimp': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    at TriLib.AssimpInterop._aiGetExtensionList(IntPtr ptrExtensionList)
    at TriLib.AssimpInterop.ai_GetExtensionList(String& strExtensionList)


    However the Unity Logs indicates this at the beginning:

    Loading native plugins
    Loading stb_image.dll
    Loading PlaneFinding.dll
    Loading assimp.dll
    Loading AudioPluginMsHRTF.dll
    Loading MicStreamSelector.dll
    Loading GpuTiming.dll
    Loading SpatialPerceptionHelper.dll
    Loading SharingClient.dll
    Loading SpatialUnderstanding.dll
     
    Last edited: Oct 29, 2019
  42. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    Hello,

    I want to get the downloaded model when it is done and replace a placeholder itself or put it under my placeholder and turn off the placeholder's renderer.


    I start by DownloadDragModel and want to manipulate the model which I downloaded in my onModelLoaded Event.
    dragGO is my placeholder GameObject instantiated into the scene. The new downloaded GameObject should be added as it's child, how do I get the new GameObject in onModelLoaded?

    Code (CSharp):
    1.     private void DownloadDragModel(string uriString)
    2.     {
    3.         AssetDownloader aDown = GetComponent<AssetDownloader>();
    4.         GameObject dragGO = SetDragCursor(uriString);
    5.         aDown.WrapperGameObject = dragGO;
    6.         aDown.AssetURI = uriString;
    7.         aDown.DownloadAsset(uriString, "GLB", onModelLoaded(), options: new AssetLoaderOptions() { GenerateMeshColliders = true }, wrapperGameObject: dragGO);      
    8.     }
    9.  
    10.     private ObjectLoadedHandle onModelLoaded()
    11.     {
    12.         Debug.LogWarning("Download Done!");
    13.         return null;
    14.     }
    The download itself etc. work perfect, thanks!
     
  43. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    When I add my placeholder to onModelLoaded, this seems to work but:

    Code (CSharp):
    1.     private ObjectLoadedHandle onModelLoaded(GameObject holderGO)
    2.     {
    3.         holderGO.GetComponent<MeshRenderer>().enabled = false;
    4.         Debug.LogWarning("Download Done!");
    5.         return null;
    6.     }
    the renderer of my placeholder gets turned off at once, and not after download is finished.
     
  44. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    Now I tried with the Progress Event, that would be even better to use because I want to have my Progress on my mesh placholder cube:

    aDown.DownloadAsset(uriString, "GLB", onModelLoaded(dragGO), wrapperGameObject: dragGO, progressCallback: onModelProgress(dragGO));
    Code (CSharp):
    1.     private AssimpInterop.ProgressCallback onModelProgress(GameObject holderGO)
    2.     {
    3.         Debug.LogWarning("Progress:" + holderGO.GetComponent<AssetDownloader>().Progress);
    4.         holderGO.GetComponent<DownloadPreview>().TextProgressGO.GetComponent<TextMesh>().text = holderGO.GetComponent<AssetDownloader>().Progress.ToString("F2") + "%";
    5.         return null;
    6.     }
    The log says warning Progress: 0 so is only called one time, also at the very beginning!
    Async is set to true, but happens with false, too.

    The Progress would be great! Then I could check here if it is done, too.
     
  45. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    I found myself: onModelProgress had the wrong signature. It is working now perfect.
    And I made myself a script for the Progress and set my text in it's update method workds good.

    Everything solved now, thanks!
     
  46. chrpetry

    chrpetry

    Joined:
    Mar 7, 2018
    Posts:
    65
    Hi there!

    I tried loading *.gltf files with TriLib. Meshes seem to work fine but I have problems on materials.
    I created some materials in blender 2.80:
    upload_2019-11-7_9-6-58.png


    If I load those spheres with TriLib though i get this:
    upload_2019-11-7_9-10-9.png

    With different 'MaterialShadingMode' set to 'Roughness'
    upload_2019-11-7_9-11-10.png


    With or without Nodes in Blender does not make a difference.
    Where do I go wrong?
     
  47. All_American

    All_American

    Joined:
    Oct 14, 2011
    Posts:
    1,528
    Trying to load a FBX through the "Load Remote Asset(URI)" function and it shows the loading percentage but then throws this error.

    It does load fine loading it locally.

    Code (CSharp):
    1. System.Exception: Error loading asset. Assimp returns: [FBX-Parser unexpected end of file]
    2.   at TriLib.AssetLoaderBase.InternalLoadFromMemory (System.Byte[] fileBytes, System.String filename, System.String basePath, TriLib.AssetLoaderOptions options, System.Boolean usesWrapperGameObject, TriLib.AssimpInterop+DataCallback dataCallback, TriLib.AssimpInterop+ExistsCallback existsCallback, TriLib.LoadTextureDataCallback loadTextureDataCallback, TriLib.AssimpInterop+ProgressCallback progressCallback, TriLib.FileLoadData customFileLoadData) [0x000a2] in C:\Users\Jason\Desktop\ModelData\ModelData\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:695
    3.   at TriLib.AssetLoaderBase.InternalLoadFromMemoryAndZip (System.Byte[] data, System.String assetExtension, System.String basePath, TriLib.AssetLoaderOptions options, System.Boolean usesWrapperGameObject, TriLib.AssimpInterop+DataCallback dataCallback, TriLib.AssimpInterop+ExistsCallback existsCallback, TriLib.LoadTextureDataCallback loadTextureDataCallback, TriLib.AssimpInterop+ProgressCallback progressCallback) [0x00003] in C:\Users\Jason\Desktop\ModelData\ModelData\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoaderBase.cs:907
    4.   at TriLib.AssetLoader.LoadFromMemoryWithTextures (System.Byte[] fileData, System.String assetExtension, TriLib.AssetLoaderOptions options, UnityEngine.GameObject wrapperGameObject, System.String basePath, TriLib.AssimpInterop+DataCallback dataCallback, TriLib.AssimpInterop+ExistsCallback existsCallback, TriLib.AssimpInterop+ProgressCallback progressCallback) [0x00014] in C:\Users\Jason\Desktop\ModelData\ModelData\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetLoader.cs:132
    5.   at TriLib.AssetDownloader+<DoDownloadAsset>d__22.MoveNext () [0x0018c] in C:\Users\Jason\Desktop\ModelData\ModelData\Assets\TriLib\TriLib\Scripts\AssetLoader\AssetDownloader.cs:230
     
  48. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    TriLib 2.0 - Beta out!

    TriLib 2.0 beta version is available for existing users.

    Improvements:
    -Cross-platform .NET code-base.
    -Original model hierarchies are kept.
    -Easier to learn with a smaller API.
    -FBX compatibility fixes with animation retargeting.
    -Metadata reading will be easier when the API be completed.
    -Many others.

    Limitations:
    -The code is not compatible with TriLib 1x.
    -There is a single sample scene on the package at the moment.
    -Only FBX and OBJ loaders have been added to this beta version.
    GLTF and DAE readers are on the works.
    -The documentation still being written.
    -The code-base may contain some bugs.
    -Core classes have been compiled to save package space.
    -Loading progress handling not implemented yet.
    -Stream loading not implemented yet.
    -Some material types not implemented yet.

    Use your invoice number to download the beta:
    https://ricardoreis.net/?p=217

    Existing users will have the official 2.0 update for free.

    Best regards,
    Ricardo Reis.
     
    smartinetz and deanryanvr2019 like this.
  49. All_American

    All_American

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

    I actually figured out that I needed to set it to allow zips int he player settings.

    I am trying to access the model after importing it. So I can make it clickable. to move and rotate it. And also to be able to import more models. Are you going to be adding functionality for this?
     
  50. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    683
    Hi!

    Are you able to test it on TriLib 2.0 beta?
    I've implemented some PBR material processing on it.

    Best regards,
    Ricardo Reis.