First, thanks for this excellent framework: currently migrating some hobby project from Three.js to Babylon and very happy with it!
Anyway, I have few troubles with the Blender exporter:
When the model have transformations, they are kept in the .babylon file. Is there an option to always convert positions to the world coordinate (like the glTF exporter does)?
Moreover, rotation do not work at all (except quaternions), it seems that the exporter doesn’t save the Euler order along with axis angles.
The exporter flip Z and Y, and I would like to prevent it from doing so, but can’t find how.
I can fix the first and second by “applying transforms” in Blender, however I can’t find an easy way to fix the last.
The project I’m migrating to Babylon is Z-up (and right-handed), so I have to make it work that way.
So far Babylon looks flexible enough, except rotation, so I will use quaternions everywhere, and I already coded few helpers to convert easily Z-up yaw/pitch/roll into quaternions.
For the Blender exporter, I decided (before reading your reply) to patch directly the .babylon output file (too much things to learn to patch the exporter itself, and I’m not enjoying Python programming). So far, for every mesh, my script swap Y/Z in the “positions” and “normals” arrays, and for the “indices” array, the first and the last of each group of three are swapped (to restore the correct face side). Is there anything else that need to be done for models? (UV?)
If there is too much work here, I would eventually prefer modifying the Python exporter, I just want to go with the shortest path. In package_level.py, if I change format_vector() and format_quaternion(), everything will be ok? Or is there other things to patch?
Go ahead. One thing that will also need to change is the version. It should now be 6.3, since functionality has changed. This is in the initial.py at the highest level.
I can also change it prior to merge, though I don’t know how.