You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification/parts/core.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ Only one of `"bufferView"` or `"uri"` MUST be defined. Both properties SHOULD NO
83
83
84
84
The `"uri"` property is a string that defines the URI of the file. If not specified, the default value is an empty string, meaning there is no URI.
85
85
86
-
The URI may be relative to the G4MF file's location, or alternatively, may be a web address, or any other valid URI format. If the URI starts with `https://`, it is treated as a web address and indicates the model is located there. Implementations may cache and reuse downloaded models as they see fit. If the URI starts with any other scheme, it uses that protocol. If the URI does not contain `://`, it is treated as a relative path to the G4MF file's location.
86
+
The URI may be relative to the G4MF file's location, or alternatively, may be a web address, or any other valid URI format. If the URI starts with `https://`, it is treated as a web address and indicates the file is located there. Implementations may cache and reuse downloaded files as they see fit. If the URI starts with any other scheme, it uses that protocol. If the URI does not contain `://`, it is treated as a relative path to the G4MF file's location.
87
87
88
88
File names SHOULD use snake case and all lowercase letters to avoid case sensitivity issues across platforms. When one G4MF resource corresponds to one file, it SHOULD have its name property set to the name of the file, excluding the file extension. This is recommended for the purposes of clarity and semantic preservation during embedding, but any name is allowed, including no name at all.
Copy file name to clipboardExpand all lines: specification/parts/data.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ When compressed data is stored in a separate file or a data URI, `"compression"`
46
46
47
47
The `"uri"` property is a string that may either be a URI to an external file, or a base64-encoded string. This property is required, except for buffer index 0 in binary G4MF files, which refers to the binary blob data chunk at the end of the file.
48
48
49
-
The URI may be relative to the G4MF file's location, or alternatively, may be a web address, or any other valid URI format. If the URI starts with `https://`, it is treated as a web address and indicates the model is located there. Implementations may cache and reuse downloaded models as they see fit. If the URI starts with any other scheme, it uses that protocol. If using a base64-encoded string, it MUST be a data URI, which starts with the MIME type data prefix `data:application/octet-stream;base64,` and is followed by the base64-encoded data. If the URI does not contain `://` and is not a data URI, it is treated as a relative path to the G4MF file's location.
49
+
The URI may be relative to the G4MF file's location, or alternatively, may be a web address, or any other valid URI format. If the URI starts with `https://`, it is treated as a web address and indicates the buffer file is located there. Implementations may cache and reuse downloaded buffer files as they see fit. If the URI starts with any other scheme, it uses that protocol. If using a base64-encoded string, it MUST be a data URI, which starts with the MIME type data prefix `data:application/octet-stream;base64,` and is followed by the base64-encoded data. If the URI does not contain `://` and is not a data URI, it is treated as a relative path to the G4MF file's location.
50
50
51
51
For binary `.g4b` G4MF files, `"uri"` MUST NOT be defined when the buffer refers to a binary blob data chunk at the end of the file. For all other buffers in a binary G4MF, `"uri"` SHOULD NOT contain base64-encoded data, since that would be less efficient than just storing the same data in the binary blob data chunks. Binary G4MF files SHOULD either have buffer data stored in binary blob chunks at the end of the file, or store buffer data in external files, or a mix, but not store buffer data in base64-encoded data URIs.
Copy file name to clipboardExpand all lines: specification/parts/model/model_file_ref.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ Models are references to other self-contained files that can be used in the scen
6
6
7
7
These models are usually used by nodes, where each node using the model becomes a new instance of the model's nodes, and the host G4MF can override the properties of the instantiated model's nodes. This allows for modularity and reusability of models across different scenes and applications. See [G4MF Node Model Instance](node_model_instance.md) for more information about how models are used by nodes. Additionally, models may be used for any other purpose, including as libraries of resources, like a library of meshes, materials, textures, or any other data.
8
8
9
-
Critically, there is one requirement for models used by nodes, regardless of format: they MUST be some kind of data that can be imported as a node or hierarchy of nodes, and placed in the scene hierarchy. This means that models cannot be arbitrary files, such as images or audio files. If there is a desire to have images visible in the scene, the node in the scene hierarchy should be a mesh with the image applied as a texture, defining the size, shape, orientation, and other visual characteristics. If there is a desire to have audio files in the scene, an extension should be used to define an audio node with volume, spatialization, and other playback characteristics. Models MUST be things that can be imported as nodes, a hierarchy of nodes, or directly used on a node, such as importing an OFF file as a standalone mesh and placing it on a mesh node.
9
+
Critically, there is one requirement for models used by nodes, regardless of format: they MUST be some kind of data that can be imported as a node or hierarchy of nodes, and placed in the scene hierarchy. This means that models cannot be arbitrary files, such as image files or audio files. If there is a desire to have images visible in the scene, the node in the scene hierarchy should be a mesh with the image applied as a texture, defining the size, shape, orientation, and other visual characteristics. If there is a desire to have audio files in the scene, an extension should be used to define an audio node with volume, spatialization, and other playback characteristics. Models MUST be things that can be imported as nodes, a hierarchy of nodes, or directly used on a node, such as importing an OFF file as a standalone mesh and placing it on a mesh node.
10
10
11
11
Implementations may choose to support any formats they wish. Support for referencing other G4MF files is highly recommended. However, the ability to reference other files at all is a niche feature, so implementations may choose not to support it at all. If a given model format referenced by a G4MF file is not supported, implementations SHOULD show a warning when importing the G4MF file.
12
12
13
13
Note that G4MF requires that all named items in the file have unique names. This requirement does not exist for names between files, so a G4MF file imported into another G4MF file may have two nodes with the same name between them. Also, if a model with multiple nodes is instantiated multiple times, there will necessarily be multiple nodes in the overall scene hierarchy which have the same name. Therefore, names are not guaranteed to be globally unique across the entire scene hierarchy, but they are guaranteed to be unique within a single G4MF file.
14
14
15
15
## Properties
16
16
17
-
These properties are the same as defined for all [G4MF File References](../core.md#file-references), but are listed here for clarity and to elaborate on the descriptions.
17
+
Model files are stored in the G4MF's document-level `"files"` array as file references. This is the same array that is used for image files, audio files, and any other files. This list of properties is the same as defined for all [G4MF File References](../core.md#file-references), but are listed here for clarity and to elaborate on the descriptions.
@@ -32,7 +32,7 @@ Only one of `"bufferView"` or `"uri"` MUST be defined. Both properties SHOULD NO
32
32
33
33
The `"uri"` property is a string that defines the URI of the model file. If not specified, the default value is an empty string, meaning there is no URI.
34
34
35
-
The URI may be relative to the G4MF file's location, or alternatively, may be a web address, or any other valid URI format. If the URI starts with `https://`, it is treated as a web address and indicates the model is located there. Implementations may cache and reuse downloaded models as they see fit. If the URI starts with any other scheme, it uses that protocol. If the URI does not contain `://`, it is treated as a relative path to the G4MF file's location.
35
+
The URI may be relative to the G4MF file's location, or alternatively, may be a web address, or any other valid URI format. If the URI starts with `https://`, it is treated as a web address and indicates the model file is located there. Implementations may cache and reuse downloaded model files as they see fit. If the URI starts with any other scheme, it uses that protocol. If the URI does not contain `://`, it is treated as a relative path to the G4MF file's location.
36
36
37
37
File names SHOULD use snake case and all lowercase letters to avoid case sensitivity issues across platforms, such as `my_model.g4b`. When embedding a model data into a buffer view, the name property SHOULD be set to the name of the file that would exist if it were external, excluding the file extension. For example, if a separate file would look like `{ "mimeType": "model/g4mf-binary", "uri": "my_model.g4b" }`, the embedded equivalent SHOULD look like `{ "bufferView": 0, "mimeType": "model/g4mf-binary", "name": "my_model" }` with `0` replaced with the correct index. This is recommended for the purposes of clarity and semantic preservation during embedding, but any name is allowed, including no name at all.
Copy file name to clipboardExpand all lines: specification/parts/model/node_model_instance.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Overview
4
4
5
-
G4MF allows referencing external model files. These model files may then be instanced on 0 or more nodes in the scene hierarchy using the `"modelInstance"` property on nodes. Each model instance MAY specify overrides for nodes and materials within the referenced model, allowing for per-instance customization.
5
+
G4MF allows referencing external model files. These model files may then be instanced on 0 or more nodes in the scene hierarchy using the `"modelInstance"` property on nodes. Each model instance MAY specify overrides for nodes and materials within the referenced model, allowing for per-instance customization. Model file references exist in the same document-level `"files"` array as all other file references, such as image files, and are referenced by index.
6
6
7
7
See [G4MF Model File Reference](model_file_ref.md) for the details of the data within each model.
|**materialOverrides**|`object`| A map of unique material names to overrides for materials within the model. |`{}` No material overrides. |
18
-
|**model**|`integer`| The index of the model that this node references.| Required, no default. |
18
+
|**file**|`integer`| The index of the model file that this node references. | Required, no default. |
19
19
|**nodeAdditionalChildren**|`object`| A map of unique node names to arrays of host node indices to append as children. |`{}` No additional children. |
20
20
|**nodeOverrides**|`object`| A map of unique node names to overrides for nodes within the model. |`{}` No node overrides. |
21
21
@@ -27,11 +27,11 @@ Each key in the `"materialOverrides"` object is the name of a material in the so
27
27
28
28
See [G4MF Material](../mesh/material.md) for more information about materials, and see [Override Mechanism](#override-mechanism) below for details on how overrides are applied.
29
29
30
-
### Model
30
+
### File
31
31
32
-
The `"model"` property is an integer index that references a model in the document-level `"models"` array. This property is required and has no default value.
32
+
The `"file"` property is an integer index that references a model file in the document-level `"files"` array. This property is required and has no default value.
33
33
34
-
Each model is a [G4MF File Reference](../core.md#file-references) which points to a file containing the model data, with valid target files being anything that can be instantiated as a node or hierarchy of nodes, such as another G4MF file. See [G4MF Model File Reference](model_file_ref.md) for the details of the properties found on each model, which are referred to by index in each model instance.
34
+
Each model is a [G4MF File Reference](../core.md#file-references) which points to a file containing the model data, with valid target files being anything that can be instantiated as a node or hierarchy of nodes, such as another G4MF file. Only files that can be instantiated as a tree of nodes are valid targets for the model instance's `"file"` property. See [G4MF Model File Reference](model_file_ref.md) for the details of the properties found on each model file, which are referred to by index here in each model instance.
0 commit comments