Convert BVH to GLTF2 for import and export


Feb 14, 2021

PROPOSED

fire

#data #pipeline #import

Context and Problem Statement

How do we ingest data? Keep it proper and have compatible outputs.

Decision Drivers

  • Inconsistent up, front and scale
  • Not standardized format

Considered Options

  • FBX
  • BVH
  • GLTF2

Decision Outcome

GLTF2 is the only choice because FBX and BVH are not standardized formats. Not BVH or FBX because they do not standardize on up, front or scale.

Positive Consequences

  • Standardized import gives better data for learning
  • Expect better gain
  • Godot supports GLTF2

Negative Consequences

  • Requires blender tooling
  • GLTF2 is not a standard format
  • Needs a GLTF2 python library

Pros and Cons of the Options

FBX

FBX can be an interchange format.

  • Good, because it is the most common
  • Good, because it is already coded to work
  • Bad, because FBX does not have a spec.

BVH

BVH is a way to import and export animations.

  • Good, because it already is here
  • Good, because no extra code
  • Bad, because there was great difficulty finding Euler order, up, scale and forward

GLTF2

GLTF is a new open specification 3d interface format.

  • Good, because it is a standard
  • Good, because we don't have problems with 3d conventions
  • Good, because I have experience with GLTF2 and less with the other formats.
  • Bad, because python libraries to handle gltf2 may be underbaked
  • Bad, because some work needs to be done

GLTF2 Pipeline

  1. We ingest anything to one skeleton in Blender.
  2. Generate meshes for the bones
  3. Export to glTF2.
  4. Pick a python library that can read simple skin gltf2
  5. Read gltf2
  6. Input into ML PyTorch
  7. process
  8. Output into glTF2
  9. Trash mesh and recreate meshes
  10. Output glTF2