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

EXT_structural_metadata - JSON encoding #71

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

lilleyse
Copy link

@lilleyse lilleyse commented Dec 2, 2024

Metadata assigned to glTF objects - like nodes and materials - is now encoded in JSON rather than in binary in a property table. This is similar to tileset and tile metadata in 3D Tiles. This is a breaking change that shouldn't have a wide impact.

@lilleyse
Copy link
Author

lilleyse commented Dec 2, 2024

Comments from @javagl in #70

The first part is a breaking change for any existing data that uses the per-object metadata that originally pointed to the property table row. I think that this was not actively or widely used, so the impact might be minimal. In terms of alleviating the possible impact, one could consider different options. In theory, just on a "brainstorming" level, the new structure could "emulate" the old one: Given a data set that defines a node with the extension object...

"EXT_structural_metadata": {
  "propertyTable": 1,
  "index": 4
}

one could add a new class to the schema, say propertyTableRow, with the properties propertyTable and index, and then just define

"EXT_structural_metadata": {
  "class": "propertyTableRow",
  "properties": {
    "propertyTable": 1,
    "index": 4
  }
}

The client application would have to be adjusted to handle this. I.e. a possibly existing function like
const metadata = node.getStructuralMetadataValue();
would now be something like

const info = node.getStructuralMetadataValue();
const metadata = gltf.getPropertyTableRow(info.propertyTable, info.index);

But again: This is just brainstorming about how existing data could be "upgraded" to the new structure.

@lilleyse
Copy link
Author

lilleyse commented Dec 2, 2024

@javagl that could be a potential upgrade path. It reminds me of an approach that Kevin suggested for creating relationships (parent/child) between property table elements.

@javagl javagl merged commit 1b93a85 into 3d-tiles-next Dec 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants