Blender exporting some parts with wrong rotations

I found that some parts of my assemblies are exported with wrong rotations. Could someone please verify this problem? Both babylon and blender files can be found here. :slight_smile:
Link to github issue.

Looks like a mission for the most knowledgeable Blender to Babylon exporter ppl I know, @JCPalmer :slight_smile:

You are going to need to simplify this model. The lots of repetitive structures, all with long names (your mesh names are not even fully displayed). Delete everything not needed to show issue.

More for my own notes, euler rotations should have their y & z swapped. The signs are flipped.

1 Like

Sorry, I didn’t meant to upload the whole model, my mistake. Now it’s simplified to 4 objects. All 3 children of one and only parent has problem with its rotations. Files were updated and are on the same link.

I am doubtful I will get to this today, and if I do stuff on the weekend, it is always my own.

One thing, from a practical perspective, is that for fixed stuff like this the performance advantages of join all the meshes (ctrl-J) prior to export are significant. On the JS side, there are just few meshes to iterate thru every frame & get the world matrix of, etc. On the GPU side, meshes which are joined that have the same material are done in a single draw call.

This problem simply will not exist after joining. For future editing capability, you need to save the joined meshes in another .blend file, & keep the current .blend separate.

1 Like

I can see advantages of merging meshes before exporting from Blender but that is unfortunately not acceptable in my case. I need assembly of separate parts so user can modify it later.

I looked at this, but not found a really good answer as of yet. If the 3 children’s rotation mode is changed to quaternion, then it works. Kind of isolate the code problem down to 1 or 2 lines though.


1 Like

Ok, repo updated with version 2.93.3. Ended up changing the order of rotations when converting the local matrix from ‘XYZ’ to ‘YXZ’, which always worked, parented or un-parented.


You are the Blender King !!!