-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Suggestion for "extras" #1120
Comments
Hi @sakrist, thanks for the idea. For my understanding, you are suggesting just to make the schema more explicit? Not an actual change to the spec? Could you also expand on:
What skips them? |
Yes. It's actually for scheme compilers. |
Ah, I see. Sounds like a good change to make. If you have the bandwidth, a pull request would be deeply appreciated. We should also test to make sure that https://github.com/AnalyticalGraphicsInc/wetzel still generates the correct reference doc. |
If anyone is interested in getting started contributing to the glTF spec/schema, this is a nice beginner issue to start with. |
I think we should require (or at least strongly suggest) that |
+1. |
Oh, a point that may have been unclear from my earlier comment — by "root" I meant the entire value of any In short, three.js exposes custom node data to users as an object — when My assumption is that no tools currently write /cc @bghgary |
I think so, considering there is no specific requirement on how |
@bghgary I'm curious as to why it's not "safe" to change the schema for |
The concern is backwards compatibility. We don't know for sure if there are assets out there that use non-object extras. We unfortunately don't have telemetry for this. For the sake of argument, let's assume there are. Many of our products validate against the schema on load. If the schema changes and we update the schema on our products, then assets with non-object extras that used to load will no longer load. In general, we should consider all changes to the schema a breaking change and avoid doing it. |
@bghgary OK, thanks. I will point out that the suggested path forward here will have much the same effect. If we have Blender and ThreeJS and other clients automatically ignore any primitive extras, they will still pass validation but the extras feature won't work for them. For some clients, there is no reasonable way around this, other than to ignore, warn, or even mutilate primitive extras. The validator would probably still be updated to flag primitives as a warning, on account of not being supported by a large portion of the ecosystem. Future glTF applications built against the current schema could start taking advantage of the continued availability of primitive extras, compounding the problem by introducing new assets into the ecosystem. Not saying we have to go one way or the other, just trying to understand the exact difference in impact between a small "breaking" schema change, vs the possibility of broken primitive extras growing in numbers in the ecosystem. |
Thanks all — per this thread and WG discussion, we cannot safely require Leaving this issue open with the "breaking change" label, for consideration in a future version of glTF, but this won't be changed in the current version. |
@donmccurdy Could we add a note to the spec about possible compatibility issues with three.js? Otherwise, I don't think that validation hint is justified. |
This is not specific to three.js — in every engine and DCC tool I'm aware of with a mechanism for application-specific metadata, that data is stored in key/values pairs: I feel pretty strongly that using an object for extras should be considered best practice. In general best practices are more likely to be followed if they're hinted at by the validator, than if they were just implementation notes. Could we include both? |
Yes, that's the goal. Validation hint will be implemented in the next validator's update. |
For
extension
glTF hasobject
type inadditionalProperties
, which is representation of a dictionary.extras
does not have any specifications. I suggest add something similar to code below:Motivation: Usually not described properties are skipped.
The text was updated successfully, but these errors were encountered: