Export to OBJ/GLTF with scaling

Hello, I have question about exporting.
I change scale of objects just before exporting to OBJ, but when I open exported file in Blender it shows dimensions before scaling.
My code:

 scene.traverse(function (object) {
    if (object.isMesh) {

        if (object.scale.x > 0) {
            object.scale.x = object.scale.x / 100;
            object.geometry.scale.x = object.scale.x / 100;        
        }
        else {
            object.scale.x = object.scale.x * 100;
        }

        if (object.scale.y > 0) {
            object.scale.y = object.scale.y / 100;
        }
        else {
            object.scale.y = object.scale.y * 100;
        }

        if (object.scale.z > 0) {
            object.scale.z = object.scale.z / 100;
        }
        else {
            object.scale.z = object.scale.z * 100;
        }
    }
});

try {
    var result = exporter.parse(scene);
    var blob = new Blob([result], { type: "text/plain;charset=utf-8" });
    saveAs(blob, "filename.obj");
}
catch (error) {
    bootbox.alert("Błąd zapisu do pliku OBJ. Prawodpodobnie jeden z elementów planszy jest nieprawidłowy");
}

Whats wrong with that code?
Thanks :slight_smile:

Try to call scene.updateMatrixWorld( true ) before this line:

var result = exporter.parse(scene);

Thanks, working with OBJ exporter, but it doesnt work with GLTF export.
Im using options like this:
var options = {
trs: true,
onlyVisible: true,
truncateDrawRange: true,
binary: false,
forceIndices: false,
forcePowerOfTwoTextures: false,
embedImages: true
};
Have You got solution for this?
Thanks a lot :slight_smile: