I export the FPS mesh and the center cube as two seperate glb files.
The center cube acts as a gimbal with movement animations (etc start move, stop move, jump), the FPS mesh has action animations (etc reload, shoot, draw). My idea is to parent the FPS mesh to the cube so that I can mix and match animations.
The orientation of each object is correct when I import them into babylon, but why does my FPS mesh end up mirrored when I parent it to the single bone in the cube using .attachToBone()?
I think this issue has something to do with the orientation of the cube bone. When a mesh is being attached to the bone and the bone is in an orientation different than whatever babylon.js interprets as the default orientation, that transformation difference is then also applied to the mesh object.
For example if I switch the cube bone direction in blender (remapping all constraints and animations to still work the same way with the new bone orientation)
Ok so here is what I’ve explored: The cube bone has local axes xyz, when mesh is attached to the bone, the mesh is orientated such that it’s local axes match with the bone’s axes. Since the bone’s axes are flipped, the mesh also ends up flipped.
This means the issue lies in the original blender model or the glb importer.
I’ve tried correcting the bone’s axes in Blender, and while rotation and location changes in Blender are reflected in babylon, reflections are not. No matter how I reflect the bone in Blender, it still ends up in babylon with the same incorrect xyz axis relationship (But in a different rotation).