Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

TriLib - Model loader package (Support via e-mail)

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

  1. Y76_Unity

    Y76_Unity

    Joined:
    Jan 29, 2018
    Posts:
    28
    Hi
    I am facing the current issue while I am loading some avatars in Android Device
    some of the avatars are loading successfully and the others are not
    i get into the log and see the following message :

    "Unable to find libassimp"

    How to solve this issue?

    Thanks in Advance
     
  2. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    Please post your Android device name and a full error log, if possible.
     
  3. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    I'll send you today later. I'm pretty busy fixing TriLib issues, so I couldn't send you yet.
     
  4. kiandroid

    kiandroid

    Joined:
    Feb 23, 2019
    Posts:
    6
    photo_2019-03-02_12-25-50.jpg

    show this error

    my os x version is : 10.14: Mojave
    and my xcode version is: 10.1
    iphone 7 ios 12
     
    leeham9 likes this.
  5. Mr_Dan_O

    Mr_Dan_O

    Joined:
    Oct 12, 2013
    Posts:
    347
    Hi there,

    This is indeed a great plugin for importing FBX files in runtime. Literally, this is the best asset available for this category. To be frank, I think this is the only option for Unity devs that actually works. I recommend this asset!

    However, as everyone else cited the problems, I notice those very issues with this asset. Including these that I hope @rickomax fix them:
    1. When importing an FBX file with at least one Morph Object, Trilib uses "Skinned Mesh" for all of the objects within the file. This is not bad, but unfortunately, it will cause the 2nd problem.
    2. The second problem is, Trilib does not combine sub-meshes for skinned meshes!! Consequently, this and the first problem will make a big issue and that is increasing drawcalls, it will also cause hierarchy to be different than what it was originally in the FBX file.
    3. When you use at least one Animated Object in your FBX file, Trilib will change the hierarchy and adds "root" game object to the instantiated Game Object. Causing the hierarchy to be different.
    4. Trilib does not scale the FBX file, There is a function for it but it does not work. I noticed someone found a workaround for it here. But the issue for the asset still exists, and I found a better workaround for it - read it at the end of this post.
    5. Trilib scales the wight of Morph Object from "0 to 100" to "0 to 1".
    6. Trilib does not support animation masks, thus if you delete a sub-object from the instantiated FBX object, all the animations will not work anymore. Animation masks are important for this case.
    7. Trilib generates too many game objects for each mesh, resulting wrong local pivots, too many transform objects and completely changing the hierarchy.
    The workarounds for the issues
    Here are my solutions for the above common issues with this asset according to the numbers. I would really be glad if the author solves those issues in a native and better way.
    1. If you want to change a non-morph object to use a mesh filter instead of skinned mesh filter, do this:
      1. Access the game object's skinned-mesh like:
        var skinMesh = yourGameObject.GetComponent<SkinnedMeshRenderer>();
      2. Then see if there is a blend shape property there:
        Code (CSharp):
        1. GetComponent<SkinnedMeshRenderer>().sharedMesh.blendShapeCount == 0
      3. If there isn't, that is not a morph object. So you have to change the renderer from Skinned Mesh to Mesh, like this:
        Code (CSharp):
        1. Destroy(yourGameObject.GetComponent<SkinnedMeshRenderer>());
        2. yourGameObject.AddComponent<MeshRenderer>();
    2. For combining all the sub-meshes of a mesh that Trilib generates for a mesh in an FBX file, you have to know that Trilib separates each mesh into sub-meshes based on its material IDs, And names them "submesh_0" "submesh_1" etc... .To merge them back into one mesh, do this:
      1. Access the root object
      2. Write a recursive function to find all the child objects with the name of "submesh_0"
      3. Get the parent of each "submesh_0" objects and add the "MeshCombiner" class to it
      4. Find all the siblings of the "submesh_0" objects
      5. Send all the "submesh_0" and all their siblings to their parent's "MeshCombiner" class to merge them.
        You can find the actual code and the "MeshCombiner" class at the end of this post (attachment 0).
    3. To delete the additional "root" game object that Trilib generates, read my code below.
      Code (CSharp):
      1.                     for (int i = root.childCount - 1; i >= 0; --i) // Get the child objects of the "root" game object only.
      2.                     {
      3.                         Transform child = root.GetChild(i);
      4.                         child.SetParent(root.parent, true); //Move the child objects from the "root" object to the parent of "root" object, this way the it would look as same as the original FBX file.
      5.                     }
      6.                     Destroy(root.gameObject);
      WARNING!! This may cause animations not to be played as there is no Animation Mask support for Trilib, apparently.
    4. Trilib just can't scale the FBX files properly, The best thing to do is, change the "System Unit" of your favorite 3D software to "Meter", Restart your software and then export your FBX file again. This way, the units of the FBX file will be the same as the one in Unity. NOTE: When exporting your FBX file, keep the "convert units" unchecked. This is the easiest option, yet.
    5. To set blend shape weights for the Trilib instantiated objects, you have to divide the numbers by 100.
      Code (CSharp):
      1. skinnedMeshRendererObject[i].SetBlendShapeWeight(index, oldValue+1/100); //I use "+1" to prevent division by zero
    6. Only the author can fix it.
    7. AFAIK, This is the AssImp artifact - AssImp is the core library that Trilib uses. To fix this you have to find the actual object in each automatically-generated-object and set it as the parent of the other object. Then delete the redundant object. You can find the actual code at the end of this post (attachment 0).
    Regards.
    ______________________________________
    THE ATTACHMENT
    Code (CSharp):
    1. void FixTrilibIssues(GameObject trilibObj) //TrilibObj is the instantiated object by Trilib that we want to fix
    2. {
    3.                     var root = trilibObj.transform.GetChild(0);
    4.                     FixAssImp(root); //Deletes all the redundant objects and combines submeshes into one all at once and recursively
    5.  
    6.                     for (int i = root.childCount - 1; i >= 0; --i) //deletes the additional "root" object
    7.                     {
    8.                         Transform child = root.GetChild(i);
    9.                         child.SetParent(root.parent, true);
    10.                     }
    11.                     Destroy(root.gameObject);
    12.  
    13.                     FixAssImpPivot(trilibObj); //fixes all the wrongly placed local pivots. NOTICE: Each object must be put in a dummy object in your 3D software else it won't work. This function retrieves the pivot by getting the one for the dummy object. E.g: Imagine an empty object (dummy object) and a box object in it, so the parent of the box object is the dummy object.
    14.  
    15.                     SetUpLOD(trilibObj); //Generates one LODGroup for LODs
    16. }
    Code (CSharp):
    1.         private void FixAssImp(Transform obj) //Recursively fixes the issues by checking  the level one child of this game object (only its childs and not grand childs or more.)
    2.         {
    3.             if (obj== null)
    4.                 return;
    5.             Transform[] lvlOneChilds = new Transform[obj.childCount];
    6.             for (int ID = 0; ID < lvlOneChilds.Length; ID++)
    7.             {
    8.                 lvlOneChilds[ID] = obj.GetChild(ID);
    9.             }
    10.  
    11.             foreach (var child in lvlOneChilds)
    12.             {
    13.                 FixAssImp(child);
    14.             }
    15.  
    16.             if (AssimpGenerated(obj.name)) //Checks the object if it is generated as an artifact of the AssImp library, if it is generated redundantly, it will set its child's parent as its own parent, then it will get deleted.
    17.             {
    18.                 for (int i = obj.childCount - 1; i >= 0; --i)
    19.                 {
    20.                     Transform child = obj.GetChild(i);
    21.                     child.SetParent(obj.parent, true);
    22.                 }
    23.                 Destroy(obj.gameObject);
    24.             }
    25.             else if (AssimpSubMesh(obj.name)) //if it is not a redundant object, then it is an actual object of the FBX file, so it will check if it is a submesh object or not, if it is a submesh of an object, it will find all the siblings of the submesh and merge them into its parent as one multi-material object. This way the object will look similar to one in the FBX file.
    26.             {
    27.                 List<GameObject> subMeshes = new List<GameObject>();
    28.                 bool combine = false;
    29.                 for (int k = 0; k < obj.parent.childCount; k++)
    30.                 {
    31.                     var kid = obj.parent.GetChild(k);
    32.                     for (int i = 0; i < 25; i++)
    33.                     {
    34.                         if (kid.name == "SubMesh_" + i)
    35.                         {
    36.                             if (kid.GetComponent<SkinnedMeshRenderer>().sharedMesh.blendShapeCount == 0)
    37.                             {
    38.                                 Mesh m = new Mesh(); //Bake the skinnedmeshes into a mesh
    39.                                 MeshRenderer mR = kid.gameObject.AddComponent<MeshRenderer>();
    40.                                 kid.GetComponent<SkinnedMeshRenderer>().BakeMesh(m);
    41.                                 mR.sharedMaterials = kid.GetComponent<SkinnedMeshRenderer>().sharedMaterials;
    42.                                 MeshFilter mF = kid.gameObject.AddComponent<MeshFilter>();
    43.                                 mF.sharedMesh = m;
    44.                                 Destroy(kid.GetComponent<SkinnedMeshRenderer>());
    45.  
    46.                                 subMeshes.Add(kid.gameObject);
    47.  
    48.                                 combine = true;
    49.                             }
    50.                         }
    51.                     }
    52.                 }
    53.                 if (combine)
    54.                 {
    55.                     var combiner = obj.parent.gameObject.AddComponent<MeshCombiner>();
    56.                     combiner.meshFilters = subMeshes.ToArray();
    57.                     combiner.Combine();
    58.                     Destroy(combiner);
    59.                     combiner.name = "%" + combiner.name; //Adding a '%' will indicate that it is a legit mesh object of the FBX file and it needs to have a correct Local Pivot. Therefore, the names of the objects in the FBX file must not include '%' as it is used here.
    60.                 }
    61.             }
    62.         }
    63.         private void FixAssImpPivot(GameObject obj)
    64.         {
    65.             List<Transform> allTransfroms = new List<Transform>();
    66.  
    67.             foreach (var item in obj.GetComponentsInChildren<Transform>())
    68.             {
    69.                 if (item.gameObject.name[0] == '%')
    70.                 {
    71.                     allTransfroms.Add(item);
    72.                 }
    73.             }
    74.  
    75.             for (int i = 0; i < allTransfroms.Count; i++)
    76.             {
    77.                 GameObject mergedObject = new GameObject();
    78.                 mergedObject.name = "obj";
    79.  
    80.                 mergedObject.transform.SetParent(allTransfroms[i].parent, false);
    81.                 allTransfroms[i].SetParent(mergedObject.transform, true);
    82.                 allTransfroms[i].name = allTransfroms[i].name.Remove(0, 1);
    83.             }
    84.         }
    85.  
    Code (CSharp):
    1.  
    2.         private bool AssimpSubMesh(string name)
    3.         {
    4.             if (name == "SubMesh_0")
    5.                 return true;
    6.             return false;
    7.         }
    8.  
    Code (CSharp):
    1.  
    2.  
    3.         private bool AssimpGenerated(string name) //This function checks if there is a name like "_$[I]AssimpFbx[/I]$_" or something like that, NOTICE: your actual objects must not have the '_' character in their name.
    4.         {
    5.             foreach (var ch in name)
    6.             {
    7.                 if (ch == '_')
    8.                     return true;
    9.             }
    10.             return false;
    11.         }
    12.  
    Code (CSharp):
    1.  
    2.  
    3.         private void SetUpLOD(GameObject theCarObj)
    4.         {
    5.             var group = theCarObj.AddComponent<LODGroup>();
    6.  
    7.             Transform[] t = theCarObj.GetComponentsInChildren<Transform>();
    8.  
    9.             List<Renderer> lod1 = new List<Renderer>();
    10.             List<Renderer> lod2 = new List<Renderer>();
    11.             List<Renderer> lod3 = new List<Renderer>();
    12.  
    13.             foreach (var trnsfrm in t)
    14.             {
    15.                 switch (GetLOD(trnsfrm.name))
    16.                 {
    17.                     case 0:
    18.                         lod1.Add(trnsfrm.GetComponent<Renderer>());
    19.                         break;
    20.                     case 1:
    21.                         lod2.Add(trnsfrm.GetComponent<Renderer>());
    22.                         break;
    23.                     case 2:
    24.                         lod3.Add(trnsfrm.GetComponent<Renderer>());
    25.                         break;
    26.                     default:
    27.                         break;
    28.                 }
    29.             }
    30.  
    31.             LOD[] lods = new LOD[3];
    32.             for (int i = 0; i < 3; i++)
    33.             {
    34.                 switch (i)
    35.                 {
    36.                     case 0:
    37.                         lods[i] = new LOD(1.0F / (i + 1), lod1.ToArray());
    38.                         break;
    39.                     case 1:
    40.                         lods[i] = new LOD(1.0F / (i + 1), lod2.ToArray());
    41.                         break;
    42.                     case 2:
    43.                         lods[i] = new LOD(1.0F / (i + 1), lod3.ToArray());
    44.                         break;
    45.                 }
    46.             }
    47.             group.SetLODs(lods);
    48.             group.RecalculateBounds();
    49.         }
    50.  
    This code gets all the LOD objects by object name, I chose all the LOD0 objects to have "--LOD0" and "--LOD1" etc... accordingly. E.g: Wheel--LOD0.
    Code (CSharp):
    1.  
    2.  
    3.         private int GetLOD(string name)
    4.         {
    5.             string lod = string.Empty;
    6.  
    7.             foreach (char x in name)
    8.             {
    9.                 if (x == '-')
    10.                     lod = string.Empty;
    11.                 else lod += x;
    12.             }
    13.  
    14.             switch (lod.ToLower())
    15.             {
    16.                 case "lod0":
    17.                     return 0;
    18.                 case "lod1":
    19.                     return 1;
    20.                 case "lod2":
    21.                     return 2;
    22.                 default:
    23.                     return 3; //NOT FOUND
    24.             }
    25.         }
    26.  
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class MeshCombiner : MonoBehaviour
    5. {
    6.  
    7.     public GameObject[] meshFilters;
    8.  
    9.     public void Combine()
    10.     { // Find all mesh filter sub-meshes and separate them by their corresponding materials
    11.         ArrayList materials = new ArrayList();
    12.         ArrayList combineInstanceArrays = new ArrayList();
    13.  
    14.         foreach (var gO in meshFilters)
    15.         {
    16.             MeshFilter meshFilter = gO.GetComponent<MeshFilter>();
    17.             Matrix4x4 myTransform = gO.transform.worldToLocalMatrix;
    18.  
    19.             MeshRenderer meshRenderer = meshFilter.GetComponent<MeshRenderer>();
    20.             // Handle bad input
    21.             if (!meshRenderer)
    22.             {
    23.                 Debug.LogError("MeshFilter does not have a corresponding MeshRenderer.");
    24.                 continue;
    25.             }
    26.             if (meshRenderer.materials.Length != meshFilter.sharedMesh.subMeshCount)
    27.             {
    28.                 Debug.LogError("Mismatch between material count and submesh count. Is this the correct MeshRenderer?");
    29.                 continue;
    30.             }
    31.             for (int s = 0; s < meshFilter.sharedMesh.subMeshCount; s++)
    32.             {
    33.                 int materialArrayIndex = 0;
    34.                 for (materialArrayIndex = 0; materialArrayIndex < materials.Count; materialArrayIndex++)
    35.                 {
    36.                     if (materials[materialArrayIndex] == meshRenderer.sharedMaterials[s])
    37.                         break;
    38.                 }
    39.  
    40.                 if (materialArrayIndex == materials.Count)
    41.                 {
    42.                     materials.Add(meshRenderer.sharedMaterials[s]);
    43.                     combineInstanceArrays.Add(new ArrayList());
    44.                 }
    45.  
    46.                 CombineInstance combineInstance = new CombineInstance();
    47.                 combineInstance.transform = myTransform * meshRenderer.transform.localToWorldMatrix;
    48.                 combineInstance.subMeshIndex = s;
    49.                 combineInstance.mesh = meshFilter.sharedMesh;
    50.                 (combineInstanceArrays[materialArrayIndex] as ArrayList).Add(combineInstance);
    51.             }
    52.         }
    53.         // For MeshFilter
    54.         {
    55.             // Get / Create mesh filter
    56.             MeshFilter meshFilterCombine = gameObject.GetComponent<MeshFilter>();
    57.             if (!meshFilterCombine)
    58.                 meshFilterCombine = gameObject.AddComponent<MeshFilter>();
    59.  
    60.             // Combine by material index into per-material meshes
    61.             // also, Create CombineInstance array for next step
    62.             Mesh[] meshes = new Mesh[materials.Count];
    63.             CombineInstance[] combineInstances = new CombineInstance[materials.Count];
    64.  
    65.             for (int m = 0; m < materials.Count; m++)
    66.             {
    67.                CombineInstance[] combineInstanceArray = (combineInstanceArrays[m] as ArrayList).ToArray(typeof(CombineInstance)) as CombineInstance[];
    68.                 meshes[m] = new Mesh();
    69.                 meshes[m].CombineMeshes(combineInstanceArray, true, true);
    70.                 combineInstances[m] = new CombineInstance();
    71.                 combineInstances[m].mesh = meshes[m];
    72.                 combineInstances[m].subMeshIndex = 0;
    73.             }
    74.  
    75.             // Combine into one
    76.             meshFilterCombine.sharedMesh = new Mesh();
    77.             meshFilterCombine.sharedMesh.CombineMeshes(combineInstances, false, false);
    78.  
    79.             // Destroy other meshes
    80.             foreach (Mesh mesh in meshes)
    81.             {
    82.                 mesh.Clear();
    83.                 DestroyImmediate(mesh);
    84.             }
    85.         }
    86.  
    87.         // For MeshRenderer
    88.         {
    89.             // Get / Create mesh renderer
    90.             MeshRenderer meshRendererCombine = gameObject.GetComponent<MeshRenderer>();
    91.             if (!meshRendererCombine)
    92.                 meshRendererCombine = gameObject.AddComponent<MeshRenderer>();
    93.  
    94.             // Assign materials
    95.             Material[] materialsArray = materials.ToArray(typeof(Material)) as Material[];
    96.             meshRendererCombine.materials = materialsArray;
    97.         }
    98.  
    99.         foreach (var item in meshFilters)
    100.         {
    101.             DestroyImmediate(item);
    102.         }
    103.     }
    104.  
    105. }
    * This code is taken from a Unity Q&A from the Net but I enhanced it and should work for general use cases,too. Add this class to the parent of the submeshes and call Combine().

    *Disclaimer: I know grammatically, "Childs" is wrong, but I use it for the sub-gameObject (transform) of a gameObject (parent transform) in coding.
    *Disclaimer: The codes could be optimized, It would be great if you optimize them and help the community.
     
    Last edited: Mar 4, 2019
    kiandroid likes this.
  6. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Not yet!
    The issues list is big at the moment, so it may take a while until I be able to fix or give some feedback.
     
  7. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    If you go to the "Frameworks" section of your project, you can search for "libz.tbd" and add it to the project.
    The screen may look like this:
     
    kiaxseventh likes this.
  8. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    This error message means Unity wasn't able to find the right TriLib runtime for your device architecture.
    You could try extracting your JAR file contents, and checking if the "libassimp.so" file included in your package is the right one for your device architecture (x86, ARM64 or ARMv7) by comparing with the files that comes with the TriLib package.
     
  9. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    H
    Hi!

    I really appreciate the feedback you're giving!
    I also appreciate for the recognition on the effort I've put into this project.
    Frankly, I would like to fix all issues we're finding on TriLib, but as you can see, keeping it cross-compatible is an extremely hard task for a single man.
    There are some issues that can be fixed or things that can be better on TriLib side, but almost all important issues are at Assimp side, which is where I'm working those days and which requires way more effort to work right on all platforms.

    The next TriLib update should have a resolution for some of these issues.

    Best regards,
    Ricardo Reis.
     
    Mr_Dan_O likes this.
  10. kiaxseventh

    kiaxseventh

    Joined:
    Jan 24, 2015
    Posts:
    6
    @rickomax please check your email inbox
    thank you
     
  11. JenniB

    JenniB

    Joined:
    Feb 15, 2018
    Posts:
    62
    Does anyone else have problems to import a gltf 2.0 model? gltf 1.0 works for me but when i load a gltf 2.0 model then the app crashes and the following message is occuring in the logcat:

     
  12. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    Looks like you're trying to load the model on the Android platform.
    Do you have the same issue loading on a desktop system? (Windows, Linux or OSX)

    Best regards,
    Ricardo Reis.
     
  13. JenniB

    JenniB

    Joined:
    Feb 15, 2018
    Posts:
    62
    No on desktop i don't have a problem with loading gltf 2.0. Just on android.
     
  14. JenniB

    JenniB

    Joined:
    Feb 15, 2018
    Posts:
    62
    Any suggestion?
     
  15. mikko_forsman

    mikko_forsman

    Joined:
    Jul 10, 2017
    Posts:
    22
    Hi @rickomax ,

    I've posted a few times about different issues in .ifc file materials, and I managed to find out the reason for one of the bugs. In some IFC models there are multiple materials with the same name, but different properties. So in those cases, models loaded through Trilib would get their colors in quite random manner since all of the materials with same names get a same color (probably from the last material of that name). However the fix was quite simple, in AssetLoaderBase.cs material generation function BuildMaterials there is a line

    materialData.Name = materialName;

    Changing that to form

    materialData.Name = materialName + "(Material " + m + ")";

    fixed a large number of issues with wrong material colors in .ifc models for us.

    Best regards,
    Mikko Forsman
     
  16. fueldown_

    fueldown_

    Joined:
    Mar 21, 2018
    Posts:
    23
    Hey @rickomax,

    I am trying my app on iOS. The amount of time taken for the same model (fbx exported from SketchUp with textures combined in a zip approx 50mb) to load on iOS (~20 secs on iPad Pro 12") as compared to Android (~4-5 secs on Oculus GO) / Desktop (~2-3 secs) is 3-5 times more. Not sure why that is. Any ideas? Thanks!
     
  17. fueldown_

    fueldown_

    Joined:
    Mar 21, 2018
    Posts:
    23
    Would you recommend the best post processing steps for mobile devices? I am struggling to find a combination of steps that will yield an optimised model with least amount of draw calls. The hierarchy is not important, so optimise graph alongside optimise meshes is useful, but it gives null reference error in case of some meshes, which is really annoying.
    This is what I am using at the moment. :
    Code (CSharp):
    1. public AssimpPostProcessSteps PostProcessSteps = AssimpPostProcessSteps.FlipWindingOrder | AssimpPostProcessSteps.MakeLeftHanded | AssimpPostProcessSteps.SplitLargeMeshes |
    2. AssimpPostProcessSteps.Triangulate | AssimpPostProcessSteps.OptimizeGraph | AssimpPostProcessSteps.OptimizeMeshes;
     
  18. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    Specific platform issues are harder to debug.
    Please send the details to: contato@ricardoreis.net if you haven't already.

    I'm working with a partner to get all issues fixed.

    Best regards,
    Ricardo Reis.
     
  19. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Thank you Mikko for your feedback!
     
  20. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    I haven't changed the default post-processing options on mobile and I've been able to load every model I've tried, besides really big models which consumes too much memory.

    Are your models too big?
     
  21. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    Many customers are having difficulties building and using TriLib on Hololens.
    Some customers had success in the past using it on Hololens.
    I don't own an Hololens device, so I can't test the builds on the actual platform, only on the simulator.

    Anyone who had success building TriLib on Hololens could share a detailed explanation on the building proccess so other customers could benefit from it?

    Best regards,
    Ricardo Reis.
     
    Last edited: Mar 22, 2019
  22. fueldown_

    fueldown_

    Joined:
    Mar 21, 2018
    Posts:
    23
    Hey @rickomax ,

    Thanks for the reply. my models can be pretty big at times, so I need to optimise them for draw calls (some can get over 5k draw calls with light probes without optimised).

    Also, did you get chance to look at the iOS issue I mentioned above?
    Thanks!
     
  23. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    I couldn't investigate it yet.

    I have an iPhone, but not the iPad Pro.
    I'll be profiling ZIP files on it as soon as I finish the issues on my list.

    I'm also planning to release native debug libraries on the next TriLib update, so you'll be able to profile it in your environment.

    Best regards,
    Ricardo Reis.
     
  24. andgest

    andgest

    Joined:
    Apr 26, 2018
    Posts:
    26
    Hello @rickomax

    First, thank you for your plugin and your job :)
    I wondered if there is a way to follow the issues where you work on (trello, gitlab, jira ...) to know what is included in the next release of trilib.
    It would allow to have visibility for issues that block some customer (in my case the error onto Unity Cloud for iOS build when it's based on app using trilib and ar features "Undefined symbols for architecture armv7").

    Thank you for your feedback
    Have a great weekend!
     
  25. littliwhite

    littliwhite

    Joined:
    May 19, 2015
    Posts:
    2
    Hello @rickomax
    Why does the zip package downloaded from the service contain material information, and the material will not be associated after loading the model?
     
  26. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    If the textures are from a format TriLib can read, probably they are not at the root ZIP directory.
     
  27. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    I've just published a page where users can keep track of issues they sent to "contato@ricardoreis.net":

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

    Passing the e-mail used at my website contact form or any e-mail address used to report an issue directly should work, since the issue have been registered at our system.
     
    andgest likes this.
  28. travancore_analytics

    travancore_analytics

    Joined:
    Aug 16, 2017
    Posts:
    1
    We are facing an issue in using Trilib to download and load a .zip file in 2018.3.3 version of unity. It uses Il2Cpp option to build in ios, but the model could not loaded, giving an exception as
    NotSupportedException: Encoding 437 data could not be found. Make sure you have correct international codeset assembly installed and enabled.
    Did anyone faced this issue? Please suggest a solution
     
  29. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    Could you send me an e-mail explaning the issue, so I can register it?

    Address:
    contato@ricardoreis.net

    Best regards,
    Ricardo Reis.
     
    Last edited: Apr 5, 2019
  30. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    For anyone with pending issues on this topic that don't have an answer yet, I would ask to send me an e-mail to: contato@ricardoreis.net as I am registering all tasks on Trello, so me and a co-worker can work and give feedback on these issues faster.
     
  31. erichris2902

    erichris2902

    Joined:
    Nov 24, 2017
    Posts:
    7
    Hi everyone, I have a problem, when using trilib in the editor it works perfectly fine but when I try to use it on an android device it gives me the following error:

    libassimp not found and then the game freeze.

    Is there any solution to this ??
     
  32. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    If you send me an e-mail to contato@ricardoreis.net containing the error details (your device model and a log, if possible) I can register your issue on our issues tracker, so I can give you a feedback regarding this issue sooner.

    Best regards,
    Ricardo Reis.
     
  33. HyunMok_Moon

    HyunMok_Moon

    Joined:
    Oct 14, 2016
    Posts:
    8
    Hi!
    Unity 2019.1f1 is released.
    Please support this version. (zlib duplicated define issue)

    Best regards,
    Hyunmok Moon.
     
  34. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    Thank you for your feedback.
    What's the platform you're getting this issue?

    Best regards,
    Ricardo Reis.
     
  35. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    2,547
    How do we get this to run on the HoloLens @rickomax ?
     
  36. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    I was checking your suggestions and I have a few observations about them:

    This can be fixed on the next update, I can add the SkinnedMeshRenderer only to the objects that have blend-shapes on it's hierarchy.

    TriLib won't combine meshes with blend-shapes because Unity will discard blend-shapes when using the CombineMeshes method, as far as I've tested.

    Hierarchy changes are made by Assimp to ensure objects will be animated correctly.

    I'll make some changes to automatically scale the FBX files on the next update.

    This has been done to mantain a fixed ratio between 0 and 1 in blend-shapes as other file formats also uses blend-shapes and this range may vary between the formats.

    I don't get what you mean exactly. If you delete any object from an avatar hierarchy, any avatar muscle that depends on this object won't work anymore.

    That's the same answer as the third item. FBX transforms are quite complex, not only objects can be animated, but geometries can be animated too. There are two paths to animate these hierarchies, the first one, used by Assimp, simply creates empty nodes between the objects to represent the in-between transforms. The second path, which wouldn't require the creation of extra nodes would be baking the animations as the FBX SDK does, unfortunately, it still not possible with Assimp, but it's on my to-do items.
     
    Last edited: Apr 20, 2019
  37. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Just compiling TriLib for UWP should work.
    Are you getting any specific error?
     
  38. mikko_forsman

    mikko_forsman

    Joined:
    Jul 10, 2017
    Posts:
    22
    Hi,

    We are running into another issue with some .ifc files. We get the following exception in Unity:

    Exception: Error loading asset. Assimp returns: [(entity #169946) type error reading literal field - expected argument 8 to IfcSpatialStructureElement to be a `IfcElementCompositionEnum`]

    We are aware that the model in question is somehow incorrectly formatted (since some other applications, such as xBim xplorer) show warnings about the same issue, but they are still able to open the file. Is this something that could be somehow overcome throught Trilib, or does it require changes to Assimp?

    Regards,
    Mikko Forsman
     
  39. IvanTesseract

    IvanTesseract

    Joined:
    Jul 1, 2013
    Posts:
    84
    Hi,

    I am trying to import FBX files at runtime, but the plugin ignores the transformation of the nodes.
    Is there a workaround for this?

    Ivan
     
  40. h935862493

    h935862493

    Joined:
    Apr 24, 2019
    Posts:
    1
    I have an FBX file that contains the color change animation, but the color change animation is lost when the TriLib plugin is loaded. What should I do?Looking forward to your reply, thank you very much!:(:(:(:(:(:(
     
  41. cdrakep

    cdrakep

    Joined:
    Mar 7, 2017
    Posts:
    2
    I'm not OP, but it was working for me on the HoloLens, then just stopped. Not sure what the issue is now. Nothing changed in the project itself!
     
  42. Mr_Dan_O

    Mr_Dan_O

    Joined:
    Oct 12, 2013
    Posts:
    347
    That is the exact problem there. Currently, Trilib includes every single object in an FBX file in the avatar hierarchy, while with animation masking you can force an object not to be included in the avatar hierarchy!! Hope I clarified it.

    With that said, I've found a solution for it. I've just separated the non-animated objects and animated objects into two different FBX files. I then import them and set their parent the same object. This and the other solutions that I've provided in my previous post here made me use Trilib without a problem for my project. Thus, I highly recommend people to use this plugin and thanks for your efforts @rickomax for developing this software.
     
  43. cdytoby

    cdytoby

    Joined:
    Nov 19, 2014
    Posts:
    170
    Hello,

    We just purchased this plugin, and we have the problem with zlib.

    We have google vr installed and it has zlib which conflict with this package.

    Then I move the zlib file into my own folder and remove the both, then this plugin has error every time I open the project, it asked me to restart either manually or automatically, it's a infinite loop.

    Then I choose to restart manually, then in log there are two warnings "Module Not found". See Screenshot:

    upload_2019-4-26_10-33-0.png

    Please fix it.
     
  44. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi Mikko!

    Sorry, IFC support on Assimp has a lot of flaws, but anyway, the next TriLib update bypass some data validation and this may allow your model to load or partially load.

    I'm planning to release a new update in one or two weeks.

    Best regards,
    Ricardo Reis.
     
  45. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi Ivan!

    Could you be more specific or send the model for testing to contato@ricardoreis.net?

    Best regards,
    Ricardo Reis.
     
  46. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi Dan!

    Thank you for your feedback again.
    I'll focus more on this subject after releasing the next update.

    Best regards,
    Ricardo Reis.
     
  47. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    The next TriLib update will use an internal ZLIB library to avoid this kind of conflict.
    I would ask you to wait until the next update release which should come in one or two weeks.

    Best regards,
    Ricardo Reis.
     
  48. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    I'll look into this feature and try to implement it on the upcoming update.
    Would be useful if you could send me the model for analysis to contato@ricardoreis.net.

    Best regards,
    Ricardo Reis.
     
  49. rickomax

    rickomax

    Joined:
    Jun 11, 2013
    Posts:
    438
    Hi!

    Did the issue started after a specific TriLib update?
    Also, are you getting any error message?

    Best regards,
    Ricardo Reis.
     
  50. andgest

    andgest

    Joined:
    Apr 26, 2018
    Posts:
    26
    Hello,

    After several test, the problem seems to come from an incompatibility between just Trilib and Unity Cloud for iOS (and not between ARKit and Trilib on Unity Cloud).
    I tried with a new empty project.
    The build work on Unity Cloud for iOS target.
    Then I add only trilib inside the project and I get the following error on Unity Cloud (if I choose the architecture "Universal" or "armv7") :
    152: ❌; Undefined symbols for architecture armv7
    153: ❌; ld: symbol(s) not found for architecture armv7
    154: ❌; clang: error: linker command failed with exit code 1 (use -v to see invocation)

    And I get the following error if I choose the architecture "arm64" :
    168: ❌; Undefined symbols for architecture arm64
    169: ❌; ld: symbol(s) not found for architecture arm64
    170: ❌; clang: error: linker command failed with exit code 1 (use -v to see invocation)
    171: ▸ clang: error: linker command failed with exit code 1 (use -v to see invocation)

    The problem start to become really annoying for our team because it's avoid to plan a release on iOS in production of our product.

    As usual, thank you very much for your lib, your work and your time.

    PS : I create a new issue on your issue tracker because the previous was wrong, the problem wasn't between Trilib and ARKit.
     
    Fangh likes this.
unityunity