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_mesh_features: Features and Properties for structured data #2082

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
705 changes: 705 additions & 0 deletions extensions/2.0/Vendor/EXT_mesh_features/README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "class.property.schema.json",
"title": "Property",
"type": "object",
"description": "A class property.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the property, e.g. for display purposes."
},
"description": {
"type": "string",
"minLength": 1,
"description": "The description of the property."
},
"type": {
"description": "Element type represented by each property value. `VECN` is a vector of `N` numeric components. `MATN` is an `N ⨉ N` matrix of numeric components stored in column-major order. `ARRAY` is fixed-length when `componentCount` is defined, and is variable-length otherwise.",
"default": "SINGLE",
"anyOf": [
{
"const": "SINGLE"
},
{
"const": "VEC2"
},
{
"const": "VEC3"
},
{
"const": "VEC4"
},
{
"const": "MAT2"
},
{
"const": "MAT3"
},
{
"const": "MAT4"
},
{
"const": "ARRAY"
},
{
"type": "string"
}
]
},
"enumType": {
"type": "string",
"description": "Enum ID as declared in the `enums` dictionary. Required when `componentType` is `ENUM`."
},
"componentType": {
"description": "Data type of an element's components. When `type` is `SINGLE`, then `componentType` is also the data type of the element. When `componentType` is `ENUM`, `enumType` is required.",
"anyOf": [
{
"const": "INT8"
},
{
"const": "UINT8"
},
{
"const": "INT16"
},
{
"const": "UINT16"
},
{
"const": "INT32"
},
{
"const": "UINT32"
},
{
"const": "INT64"
},
{
"const": "UINT64"
},
{
"const": "FLOAT32"
},
{
"const": "FLOAT64"
},
{
"const": "BOOLEAN"
},
{
"const": "STRING"
},
{
"const": "ENUM"
},
{
"type": "string"
}
]
},
"componentCount": {
"type": "integer",
"minimum": 2,
"description": "Number of components per element for fixed-length `ARRAY` elements. Always undefined for variable-length `ARRAY` and all other element types."
},
"normalized": {
"type": "boolean",
"description": "Specifies whether integer values are normalized. This applies when `componentType` is an integer type. For unsigned integer component types, values are normalized between `[0.0, 1.0]`. For signed integer component types, values are normalized between `[-1.0, 1.0]`. For all other component types, this property must be false.",
"default": false
},
"max": {
"oneOf": [
{
"type": "number"
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
}
],
"description": "Maximum allowed value for the property. Only applicable for single-value numeric types, fixed-length arrays of numeric types, `VECN`, and `MATN` types. For single-value numeric types this is a single number. For fixed-length arrays, `VECN`, and `MATN` types, this is an array of component-wise maximum values. The `normalized` property has no effect on the maximum, which always contains integer values."
},
"min": {
"oneOf": [
{
"type": "number"
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
}
],
"description": "Minimum allowed value for the property. Only applicable for single-value numeric types, fixed-length arrays of numeric types, `VECN`, and `MATN` types. For single-value numeric types this is a single number. For fixed-length arrays, `VECN`, and `MATN` types, this is an array of component-wise minimum values. The `normalized` property has no effect on the minimum, which always contains integer values."
},
"required": {
"type": "boolean",
"description": "If required, the property must be present for every feature of its class. If not required, individual features may include `noData` values, or the entire property may be omitted from a property table or texture. As a result, `noData` has no effect on a required property. Client implementations may use required properties to make performance optimizations.",
"default": false
},
"noData": {
"oneOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
},
{
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
],
"description": "A `noData` value represents missing data — also known as a sentinel value — wherever it appears. If omitted (excluding variable-length `ARRAY` properties), property values exist for all features, and the property is required in property tables or textures instantiating the class. For variable-length `ARRAY` elements, `noData` is implicitly `[]` and the property is never required; an additional `noData` array, such as `[\"UNSPECIFIED\"]`, may be provided if necessary. For fixed-length `ARRAY` properties, `noData` must be an array of length `componentCount`. For `VECN` properties, `noData` must be an array of length `N`. For `MATN` propperties, `noData` must be an array of length `N²`. `BOOLEAN` properties may not specify `noData` values. `ENUM` `noData` values must use a valid enum `name`, not an integer value."
},
"semantic": {
"type": "string",
"minLength": 1,
"description": "An identifier that describes how this property should be interpreted. The semantic cannot be used by other properties in the class."
},
"extensions": {},
"extras": {}
},
"dependencies": {
"componentCount": [
"type"
]
},
"required": [
"componentType"
]
}
34 changes: 34 additions & 0 deletions extensions/2.0/Vendor/EXT_mesh_features/schema/class.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "class.schema.json",
"title": "Class",
"type": "object",
"description": "A class containing a set of properties.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the class, e.g. for display purposes."
},
"description": {
"type": "string",
"minLength": 1,
"description": "The description of the class."
},
"properties": {
"type": "object",
"description": "A dictionary, where each key is a property ID and each value is an object defining the property. Property IDs may contain only alphanumeric and underscore characters.",
"minProperties": 1,
"additionalProperties": {
"$ref": "class.property.schema.json"
}
},
"extensions": {},
"extras": {}
}
}
70 changes: 70 additions & 0 deletions extensions/2.0/Vendor/EXT_mesh_features/schema/enum.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "enum.schema.json",
"title": "Enum",
"type": "object",
"description": "An object defining the values of an enum.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the enum, e.g. for display purposes."
},
"description": {
"type": "string",
"minLength": 1,
"description": "The description of the enum."
},
"valueType": {
"default": "UINT16",
"description": "The type of the integer enum value.",
"anyOf": [
{
"const": "INT8"
},
{
"const": "UINT8"
},
{
"const": "INT16"
},
{
"const": "UINT16"
},
{
"const": "INT32"
},
{
"const": "UINT32"
},
{
"const": "INT64"
},
{
"const": "UINT64"
},
{
"type": "string"
}
]
},
"values": {
"type": "array",
"description": "An array of enum values. Duplicate names or duplicate integer values are not allowed.",
"items": {
"$ref": "enum.value.schema.json"
},
"minItems": 1
},
"extensions": {},
"extras": {}
},
"required": [
"values"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "enum.value.schema.json",
"title": "Enum value",
"type": "object",
"description": "An enum value.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the enum value."
},
"description": {
"type": "string",
"minLength": 1,
"description": "The description of the enum value."
},
"value": {
"type": "integer",
"description": "The integer enum value."
},
"extensions": {},
"extras": {}
},
"required": [
"name",
"value"
]
}
Loading