glTF-Transform icon indicating copy to clipboard operation
glTF-Transform copied to clipboard

Support KHR_animation_pointer

Open heeen opened this issue 7 months ago • 2 comments

Describe the bug importing a file with KHR_animation_pointer and re-serializing it breaks said extension

To Reproduce WebIO with ALL_EXTENSIONS registered import document through io.readJSON export document through io.writeJSON

Expected behavior it is expected that the gltf-transform without explicit changes is idempotent.

original file contains

"extensionsUsed": [
    "KHR_animation_pointer"
  ],

and animations

  "animations": [
    {
      "channels": [
        {
          "sampler": 0,
          "target": {
            "path": "pointer",
            "extensions": {
              "KHR_animation_pointer": {
                "pointer": "/nodes/2/rotation"
              }
            }
          }
        }
      ],
      "samplers": [
        {
          "input": 13,
          "interpolation": "LINEAR",
          "output": 14
        }
      ],
      "name": "SpinPlatform"
    },
    {
      "channels": [
        {
          "sampler": 0,
          "target": {
            "path": "pointer",
            "extensions": {
              "KHR_animation_pointer": {
                "pointer": "/nodes/5/rotation"
              }
            }
          }
        },
        {
          "sampler": 1,
          "target": {
            "path": "pointer",
            "extensions": {
              "KHR_animation_pointer": {
                "pointer": "/nodes/3/translation"
              }
            }
          }
        }
      ],

resulting file does not contain extensionsUsed. animations look like:

"animations": [
        {
            "name": "SpinPlatform",
            "samplers": [
                {
                    "input": 13,
                    "output": 14,
                    "interpolation": "LINEAR"
                }
            ],
            "channels": [
                {
                    "sampler": 0,
                    "target": {
                        "path": "pointer"
                    }
                }
            ]
        },
        {
            "name": "animate the inner box",
            "samplers": [
                {
                    "input": 15,
                    "output": 16,
                    "interpolation": "LINEAR"
                },
                {
                    "input": 17,
                    "output": 18,
                    "interpolation": "LINEAR"
                }
            ],
            "channels": [
                {
                    "sampler": 0,
                    "target": {
                        "path": "pointer"
                    }
                },
                {
                    "sampler": 1,
                    "target": {
                        "path": "pointer"
                    }
                }
            ]
        }
    ],

Versions:

  • Version: 4.0.2
  • Environment: Browser

heeen avatar Jul 03 '24 14:07 heeen