* fix export fbx wrong Materials index in LayerElementMaterial
* Refix export fbx wrong Materials index in LayerElementMaterial. Materials index should be the order of Materials in connections of the Model node.
---------
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
There were some typos and incorrect offsets in a previous PR. This fixes part of it, correctly exporting the UV.
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fix fbx export. Nodes "LayerElementNormal" and "LayerElementColor" should be written only when actual data are exported.
* Update FBXExporter.cpp
- Fix intentions
- use empty instead of size for checking data exists
* refactoring
---------
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fix Whitespace
No functional changes. This commit removes trailing spaces, undesired line breaks, and formatting screwups.
* Remove more useless line breaks in license (500 out of 630 license copies do NOT use double line breaks here)
---------
Co-authored-by: Krishty <krishty@krishty.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* [FBX] Allow export multi materials per node
Previously it was assumed that each node would export a single material. This removes that
assumption, and also allows for exporting multiple meshes with a single node. Previously they
would each be seprated into their own node.
* Support for animations with multiple meshes too
---------
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Previously it was possible that the number of vertices between the mesh and morph mesh varied.
This may have caused problems in tools like Blender, and this ensures there's a 1-1
correspondence between vertices.
In addition, exporting doubles broke meshlab on import, so now it exports floats.
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
When loading a mesh exported from assimp into Blender, it warns that it has an incorrect class.
While debugging, I traced it back to this being `Blendshape` where `Geometry` was expected. This
is likely because this node describes a `Geometry`, which is used as a blendshape. I'm not sure
if any other DCC tools or places to import it expect `Blendshape` instead (i.e. was this code
ever tested?), but it fixes its use in Blender.
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
It seems that rotation matrices later expect radians.
This conversion breaks it, and was validated on the conversion of
`cesium_man.glb` --> `cesium_man.fbx`
Failed to get floating values (e.g. opacity) from scene material when ASSIMP_DOUBLE_PRECISION is defined, so they are not reflected to output fbx file.