GltfExport - flipped camera

Adding you buddy to the loop @feuerstein

Thanks @MeshSlayer for the heads-up !
Hey @srzerbetto , I am afraid that it’s not fixed yet.
please check this playground : Babylon.js Playground
I made a simple animation that rotates the camera to the right (as seen on the playground).
but once you re-open that downloaded GLB in the sandbox, it’s clear that the rotation is going in the other direction.
As per this thread, it’s been a while that the camera’s been struggling with the export.
One workaround is to parent the camera to a TransformNode and animate the transform node instead.
Eager to hear from you!

Adding @alexchuber to this conversation

Will investigate today.

It looks like I missed testing the original PG when we updated the exporter, so I’ve just put up a fix for it.

As for this new bug… I see some probable causes, but it will take me time to fix. Thanks for the report!

Sorry this took a while. While fixing the camera rotation animations, I noticed that the solution was inconsistent with both the glTF loader and a related piece of the glTF exporter. It turned out to be a very nasty bug that led to Breaking change in target camera rotations when using right-handed system !

In any case, this PR should address the broken camera rotation animations:

Hello,

Since version 8.11.0,I’ve been experiencing a problem exporting the arcRotateCamera. The exported rotation is always x: 90°, y: 0°, z: 180°, regardless of the target.

Here’s a playground that demonstrates the problem. The camera rotation is exported correctly in version 7.54.2, but not in the latest version.

scene exported with v.7.54.2

scene exported with v.8.29.0

The issue seems to stem from the changes made in this PR https://github.com/BabylonJS/Babylon.js/pull/16708/files , in _setCameraTransformation function. Previously, we used babylonCamera.getWorldMatrix to define the rotation. Now we are using the babylonCamera.rotationQuaternion (always undefined for arcRotateCamera) or the babylonCamera.rotation (always x:0, y:0, z:0) . Tried to console.log the rotation and rotationQuaternion properties in this PG to illustrate the point Babylon.js Playground

Am I the only one having this problem?
I don’t know if the problem comes from the camera or the exporter. Or from my use of the camera..

Thanks for the report-- good catch! I missed that ArcRotateCamera doesn’t use those properties. I’ve added a test so it doesn’t happen again.