I'm having trouble importing models in Blender. I know this dataset is meant for Unity, but I still hope for some help with Blender specifically.
Here is the script that I eventually came up with to import a single FBX file:
from pathlib import Path
import bpy
rocketbox_root = Path('/path/to/cloned/Microsoft-Rocketbox')
avatar_path = rocketbox_root / 'Assets/Avatars/Adults/Female_Adult_01/Export/Female_Adult_01.fbx'
bpy.ops.object.delete(use_global=False, confirm=False) # delete cube
bpy.ops.import_scene.fbx(filepath=str(avatar_path))
# Fix paths to textures
for im in bpy.data.images:
im.filepath = im.filepath.replace('../../../../../temp/Humans/with_opacity_version/f001/textures', '../Textures')
# Workaround: make opacity texture fully transparent
bpy.data.materials['f001_opacity'].blend_method = 'CLIP'
bpy.data.materials['f001_opacity'].alpha_threshold = 1
In order to use it, launch Blender, switch to the "Scripting" tab, create a new script via the "+ New" button, paste this code and change the rocketbox_root
variable to the path of the cloned repository.
In this script, I replace paths to textures which are hardcoded in the FBX file. In addition, I disable the opacity texture by making all polygons associated with it fully transparent. Here is what the imported model looks like without that step:
![01_no_opacity_fix](https://user-images.githubusercontent.com/1315874/85050252-7a1ea800-b19e-11ea-9dfe-cccf86fccfd3.png)
If I set blend method to "alpha blend", I get this:
![02_opacity_alpha_blend](https://user-images.githubusercontent.com/1315874/85050297-89055a80-b19e-11ea-9ab1-3123e6593769.png)
The result with my workaround (mode = alpha clip, clip threshold = 1) is as follows:
![03_opacity_alpha_clip_1](https://user-images.githubusercontent.com/1315874/85050322-91f62c00-b19e-11ea-8b1c-f15f952cd2fe.png)
All of these images are rendered with the Eevee renderer, on white background. I am using Blender 2.83.
I am also not sure what the purpose is for the eyelash opacity textures. The eyelashes are already baked into the color map for the head texture, why duplicate them in the opacity texture?
Are there any guidelines for importing the models in Blender? Ideally, I would prefer a Python script that does everything, not instructions on what things need to be changed in the GUI.