Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
GLTFDocument¶
Inherits: Resource < RefCounted < Object
Class for importing and exporting glTF files in and out of Godot.
Description¶
GLTFDocument supports reading data from a glTF file, buffer, or Godot scene. This data can then be written to the filesystem, buffer, or used to create a Godot scene.
All of the data in a GLTF scene is stored in the GLTFState class. GLTFDocument processes state objects, but does not contain any scene data itself.
GLTFDocument can be extended with arbitrary functionality by extending the GLTFDocumentExtension class and registering it with GLTFDocument via register_gltf_document_extension. This allows for custom data to be imported and exported.
Tutorials¶
Methods¶
append_from_buffer ( PackedByteArray bytes, String base_path, GLTFState state, int flags=0 ) |
|
append_from_file ( String path, GLTFState state, int flags=0, String base_path="" ) |
|
append_from_scene ( Node node, GLTFState state, int flags=0 ) |
|
generate_buffer ( GLTFState state ) |
|
generate_scene ( GLTFState state, float bake_fps=30, bool trimming=false, bool remove_immutable_tracks=true ) |
|
void |
register_gltf_document_extension ( GLTFDocumentExtension extension, bool first_priority=false ) static |
void |
unregister_gltf_document_extension ( GLTFDocumentExtension extension ) static |
write_to_filesystem ( GLTFState state, String path ) |
Method Descriptions¶
Error append_from_buffer ( PackedByteArray bytes, String base_path, GLTFState state, int flags=0 )
Takes a PackedByteArray defining a GLTF and imports the data to the given GLTFState object through the state
parameter.
Note: The base_path
tells append_from_buffer where to find dependencies and can be empty.
Error append_from_file ( String path, GLTFState state, int flags=0, String base_path="" )
Takes a path to a GLTF file and imports the data at that file path to the given GLTFState object through the state
parameter.
Note: The base_path
tells append_from_file where to find dependencies and can be empty.