-
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
Usage of null in glTF #646
Comments
One should be careful here. The treatment of For example, in the non-JavaScript world, it may be hard to distinguish between a property that has the value Would the use of The case of the
which is a remedy to the For the poroposed case of "switching off" a mesh primitive by setting its material to (Note that these are not strict arguments against this proposal. There are just some caveats to consider) |
Thanks for feedback, @javagl! There are some caveats in JavaScript, too: var a = {};
a.b = null;
a.c; // undefined
a.c == a.b; // true
a.c === a.b // false Maybe, we can resolve those two cases with other means and avoid My main concern with
And Material case was just another example of possible |
This may be a too specific point for the question about the usage of (If (BTW: For the particular case of the URI in binary glTF, I considered to weasel out of this question not by assigning |
Looks like it doesn't mean to be "backward compatible" at all. Assets have another file extension (
Or just an empty string or an empty fragment ( |
Great discussion here, thanks @lexaknyazev @javagl! It sounds like introducing It sounds like the main concern is that extensions can't remove properties, which as also be troublesome to me; I wrote the Binary glTF extension and clearly didn't handle the Perhaps we should refocus this discussion on extensions and continue post 1.0.1? |
Surely post 1.0.1. |
@lexaknyazev in practice, do you still think this is worth considering? |
We still don't allow |
Schemas and the validator do not allow explicit |
null
is one of four JSON primitive types. At the current state of spec, no field can havenull
as a value.Yet, there could be reasonable use cases for it:
Stub for required
uri
fields instead of an empty data URI (because such URI means actually "empty plain text string" and requires syntax check in general case):A way to mark a mesh as non-renderable by setting
[mesh.primitive.]material : null
.Allowing field to be "nullable" will require a small change in JSON schema, e.g.:
The text was updated successfully, but these errors were encountered: