This topic describes the ST_ImportGLTF function. This function imports a GL Transmission Format (glTF) file into a database.
Syntax
Syntax 1
boolean ST_ImportGLTF(text table_name, text url, text id, text options default '{}');
Syntax 2
boolean ST_ImportGLTF(text table_name, bytea content, text id, text options default '{}');
Parameters
Parameter | Description |
table_name | The name of the glTF table and the prefix of the sharded tables of the glTF table. |
url | If the gIFC file is stored in an object storage service, such as an Object Storage Service (OSS) bucket, use this parameter. For more information, see Object storage paths. |
id | The ID of the gIFC file. |
content | If you want to import the gIFC file by using its binary representation, use this parameter. Alternatively, you can use the url parameter. |
options | The options for the import. Valid values:
|
The following table describes the fields of the options parameter.
Field | Type | Description | Default value | Example value |
schema | String | The schema of the required table. | public | postgres |
flip_y_z | Boolean | Specifies whether to exchange values on the y-axis and z-axis. Note By default, the y-axis of glTF is vertical while the z-axis is vertical in GanosBase. If you set this parameter to true, take note of the following points:
| true | false |
split_meshgeom | Boolean | Specifies whether to divide geometry data. Note If you want to divide geometry data, take note of the following items:
| false | true |
split_texture | Boolean | Specifies whether to divide texture data. Note If you want to divide texture data, take note of the following items:
| false | true |
sfmesh_column | String | The data field of the primary table. | gltf_data | my_data |
gltf_id_column | String | The data ID field of the primary table. | gltf_id | my_id |
Description
This function imports a glTF file of the sfmesh type into a database.
The function can be called to import a glTF file that is stored in an object storage service, such as an OSS bucket, into a database.
The function can be called to read the binary data of a glTF file to the memory and then import the data into a database.
The following lists describe the data limits:
Only data of the sfmesh type is supported. Data that is captured by cameras and obtained from skeletons and animations is ignored.
Only data that is obtained by using the triangulation method is supported.
Data that is compressed by Draco is not supported.
Only the fully embedded mode is supported. Binary plug-ins or texture plug-ins are not supported. If the preceding limits are not met, failures occur.
After the import is successful, the following tables are generated in the database:
Examples
SELECT ST_ImportGLTF('test_gltf', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_gltf.gltf', 'my_gltf');
---------
t