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. Dismiss Notice

Externally loaded obj, transferring blendshapes and messed up vertex orders...

Discussion in 'Editor & General Support' started by sgt3v, Feb 14, 2019.

  1. sgt3v

    sgt3v

    Joined:
    Feb 19, 2017
    Posts:
    28
    Hello forum,

    I have an issue that externally loaded .obj turn into a mess when transferred blendshapes are applied from an .fbx. The same problem does not happen when I drag drop the obj into the editor.

    I have an .obj and .fbx of the same model, where the .fbx format contains several blendshapes on it. They have the same topology and vertex count both exported from Blender. When I have both models in Unity project where it exports them internall, I have no problem. Trasferring the blendshapes and everything works right.

    However when I load load the .obj during runtime using an external .obj loader (where I have to since Unity does not provide a solution to this that I know of) then iterate trough the same steps to transfer blendshapes and change their values all i have it a model with lot's of spikes on it. Obviously the vertex order of the .obj loader i'm using (https://github.com/gpvigano/AsImpL) and how unity's are have different.

    Since the shape of the models are sightly different (same model, same topology, same everything except being sightly morphed) I can not go for finding same position vertexes and reorder them.

    I tried almost every importer options from an AssetPreprocessor still no luck. Does anyone have any suggestion how this could be done?

    The bigger question is why Unity still have not exposed their .obj loader to the developers or is there any plan to do so soon?
     
  2. sgt3v

    sgt3v

    Joined:
    Feb 19, 2017
    Posts:
    28
    For the people who may have encounter the same problem in the future:

    - Include this .obj exporter into your project (http://wiki.unity3d.com/index.php/ExportOBJ) and capture the mesh that has been loaded from the .obj loader you use.
    - Rotate the .obj 180 degrees to make it face you (otherwise blendshapes will be moving wrong way)
    - Add the blendshapes and export it to the .fbx which you'll use as blendshape source.
    - Disable pretty much every import option on your model except for import blendshapes. And select import tangents.