facebookincubator / FBX2glTF

A command-line tool for the conversion of 3D model assets on the FBX file format to the glTF file format.
Other
2.1k stars 332 forks source link

Add support for arbitrary number of skinning weights. #204

Closed etherlore closed 5 years ago

etherlore commented 5 years ago

This change allows for an arbitrary number skinning weights per vertex. The number of weights allowed is controlled by the command line parameter --skinning-weights. This defaults to 4 so as to not change the current behavior. Normalization now also has a command line parameter --normalize-weights which also defaults to the current behavior of normalizing.

The entire pipeline has been upgraded to be agnostic to the number of weights per vertex. The Vec4 structures are populated at the end. Any remainder of weight/index space in the Vec4 structures are zeroed, again as the previous behavior. The code also determines the minimum set of Vec4s are globally for the mesh, and the command line parameter so as to not bloat with all zero structures. All vertices have the same number of Vec4s in the end, which I believe is what the spec requires.

etherlore commented 5 years ago

Was hoping to get an option to rebase through the webUI, but that didn't happen, so closing this for now.