EpicGames / MetaHuman-DNA-Calibration

https://epicgames.github.io/MetaHuman-DNA-Calibration/
Other
454 stars 121 forks source link

Exporting normals from DNA file #34

Closed MykytaPetrenko closed 1 year ago

MykytaPetrenko commented 1 year ago

Hi! I am trying to understand how do normals work for Metahumans and specifically for DNA calibration. The fact is DNA file contains information about vertex normals. It makes sense at least for the seam betweet the head and the body. But I am not sure that the normals from the DNA file are exported when I export FBX using examples/dna_viewer_export_fbx.py. The docstring for build method MetaHuman-DNA-Calibration/dna_viewer/builder/mesh.py says that normals are added and as I understand this code is used to build meshes before FBX export, but looking deeper In the building process I have found nothing about reading normals from DNA and writing them to the meshes. I have also compared two FBX models: exported from DNA with maya, the same Metahuman but exported as FBX from Unread Engine. An the meshes looks differently. The comparison is made in Blender by enabling and disabling custom normals (auto smooth option in blender stands for it) for both meshes, and it does not affect the mesh extracted from the DNA. As for the mesh from Unreal Engine I can clearly see changes when enable custom normals. I am also trying to rebuild the mesh from DNA in blender using my own script keeping all normal data, and the result looks closer to exported from Unreal Engine.

So thats make me think that DNA calib library does not adds normals from DNA file when builds mesh in Maya or exporting using examples/dna_viewer_export_fbx.py. Maybe I am wrong, or it is expected behavious of the script.

video demonstration

Thanks