Load->Save GLTF. How is the saved one different from the original one?

Hi,
We load a GLTF. We then save it. The saved gltf is different than the original one.(One example below) That’s ok and we understand that it would be unnecessary difficult to save the scene to a gltf that is similar to the one we are loading from.

My question is how can we find out about all the differences? Where should we look at? We would like to build a fairly comprehensive list of what would be different between the original and the saved gltf and to make sure we support this cases for our clients, because we are integrating different tools for processing gltfs in the process.

Here is an example:
A gltf with a mesh with two primitives is transformed to two nodes(two meshes) each with one primitive.
Original gltf contains

"meshes": [
    {
      "extras": {
        "customMeshOptions": "XXX"
      },
      "primitives": [
        {
          "attributes": {
            "POSITION": 1,
            "NORMAL": 2
          },
          "indices": 0,
          "material": 0
        },
        {
          "attributes": {
            "POSITION": 4,
            "NORMAL": 5
          },
          "indices": 3,
          "material": 1
        }
      ],
      "name": "XXX"
    },

When this is loaded and save the resulting gltf contains

 "nodes": [
    {
      "name": "13063938854199322380_primitive0",
      "mesh": 0
    },
    {
      "name": "13063938854199322380_primitive1",
      "mesh": 1
    },
    {
      "rotation": [
        0.4999999925494185,
        0.4999999925494185,
        -0.49999996274709657,
        0.5000000521540624
      ],
      "name": "13063938854199322380",
      "children": [
        0,
        1
      ]
    },
  ...
  "meshes": [
    {
      "primitives": [
        {
          "mode": 4,
          "attributes": {
            "POSITION": 0,
            "NORMAL": 1
          },
          "indices": 2,
          "material": 0
        }
      ]
    },
    {
      "primitives": [
        {
          "mode": 4,
          "attributes": {
            "POSITION": 3,
            "NORMAL": 4
          },
          "indices": 5,
          "material": 1
        }
      ]
    },

Pinging @bghgary

The biggest difference is that the loader creates separate meshes for each primitive of the glTF. I’m not sure why there is a rotation in the output. Do you have an example I can debug?

Thanks.

The rotation is there as it comes from the original node it self that has the meshes. I was two lazy to find the node in the original 10K lines gltf.

I can’t share these specific model, but I think the rotation is there as expected.

Apart from separating meshes do you know what else could we expect?

I can’t think of anything else, but it’s hard to think of all the possibilities without a model to test.

Thanks. I will see what I could do to extract part of the model.