Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support KHR_animation_pointer #1448

Open
heeen opened this issue Jul 3, 2024 · 2 comments
Open

Support KHR_animation_pointer #1448

heeen opened this issue Jul 3, 2024 · 2 comments

Comments

@heeen
Copy link

heeen commented Jul 3, 2024

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 heeen added the bug Something isn't working label Jul 3, 2024
@heeen
Copy link
Author

heeen commented Jul 3, 2024

source file boxanimated-source.zip
transformed file archive(1).zip

@donmccurdy
Copy link
Owner

Hi @heeen! glTF Transform provides official implementations of the extensions listed here:

https://gltf-transform.dev/extensions

For any others, you'd need to create and register an implementation of that extension. All provided extensions are implemented in a separate package (@gltf-transform/extensions) to make sure that third-party extensions also have access to necessary APIs. I should caution that KHR_animation_pointer is not a trivial extension to support. Loosely related:

@donmccurdy donmccurdy added feature New enhancement or request package:extensions needs investigation and removed bug Something isn't working labels Jul 3, 2024
@donmccurdy donmccurdy changed the title KHR_animation_pointer extension not preserved Support KHR_animation_pointer Jul 3, 2024
@donmccurdy donmccurdy added this to the 🗄️ Backlog milestone Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants