Problem: y and z axes inverted only in scaling property

Hello everybody,
I’m encountering a problem and i wondered if anyone has stumbled on it too.
In my scene i have imported a .gltf model (exported from Blender with the setting → transform: +Y up = enabled).

This model has a wrapper empty object and inside of it, there’s a mesh.
The problem is that, while the empty object scales accordingly to the Babylon axes (y up), when i scale the mesh inside, it inverts the z and y axes.
So, to increase its height, i have to work on the z ax instead of the usual y ax.
When i change the parameters of the position of that same mesh though, it works as expected (y up).

Here is a playground of a simplified situation.

Thank you in advance

Adding @PirateJC

1 Like

You have a 90° rotation on the X axis for the box object, that must explain why.

1 Like

i found that while exporting from blender as gltf or glb … when choosing y up it does not bake new axis information , it simply applies rotations and negative scales in some instances.

So the model displays correctly but as you found using transform methods has unexpected results

So i found a solution for this. I now export them with the blender z up. Then inside babylon I created one root node in the scene. I adjusted the rotation and scale on this root node. So now the imported models are all added into this root object and as such, display correctly and transform methods work as expected.

Could probably be done much better but this worked well for me , my root object looked like this:

//create root transformnode for rotation fix 

        this.rootTransformNode = new BABYLON.TransformNode("root_transform_fix");

        this.rootTransformNode.rotation = new BABYLON.Vector3(-1.5708, 0, 0);

        this.rootTransformNode.scaling = new BABYLON.Vector3(-1, 1, 1);
1 Like

aaah you’re right! all the internal meshes have this rotation.
Thank you for finding out the problem. The models I’m working on are made by the client, and I missed that rotation setting.
Have a good day!

Thank you for the answer! This trick could have worked, but I absolutely need to work on the single mesh (in the real model there will be a lot of single meshes and i have to pick them and transform them in a isolated way).
But if that wasn’t the case, I would have definitely tried this.
Have a good day!

i cant see why you cant do that ? I have a configurator that builds an entire scene from imported .glb files. The .glb were exported as normal coordinates ( hence would display wrong in babylon ) but I add them all to my single root node with the rotation and scale fix.

I can target any of these loaded models and do any transformations on them , translation , rotation , scale using the expected axis , as if it was in blender.

1 Like

First of all, great work on that project!
I’m developing a configurator too, which should have a real deep level of interaction. It’ll be really challenging, and I will probably fill up this forum with questions in the next months haha.

Ok now I think I get what you mean.
I’ll try also this way, so that the models won’t need a redo in Blender.
Thank you again for your time!