Rotate root node of imported glb file

I have an issue in my current project which seems to not allow to setup the orientation of an imported gltf file.

Playground scene

I want to rename the default __root__ node created on import ('cause I have to load/unload many files, and naming the root object make them easy to spot), and then playing with its Y rotation.
But it seems to be overwritten somewhere, even after the onLoad of the ImportMesh.

Is my way to manipulate the imported file wrong?

This is because in gltf we rely on quaternions:
https://www.babylonjs-playground.com/#J21C6T#1

Let me now summon @Deltakosh to figure an easy to spot way from the inspector :slight_smile:

1 Like

OK! thanks for the explanation.

Maybe this deserve a point on this doc page? Babylon.js Documentation

1 Like

I can probably hide the rotation property if there is a rotation quaternion one
And it is mentioned in the doc that rotation quaternion is higher priority than rotation:)

I like the property as it works great, maybe renaming or adding something to know it is a quaternion that is used ?

@Vinc3r: how do fell about my idea?

I think just hiding the rotation property will not be explicit. As sebavan suggesting, we have to see that a quaternion is used.

Don’t know if possible to make something like that:

Or, probably a lot more simple:

I did not mean to hide it but to replace it by the rotationQuaternion property

That looks OK for me.

ok then I’ll do that :slight_smile:

2 Likes

Wait! this is already the case. If there is a quaternion it is already used Oo
But for some reasons it is not working…

Fixing it right now :slight_smile:

1 Like

Seems to work now, GG

My pleasure!