Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
GLTFState¶
Inherits: Resource < RefCounted < Object
Represents all data of a GLTF file.
Description¶
Contains all nodes and resources of a GLTF file. This is used by GLTFDocument as data storage, which allows GLTFDocument and all GLTFDocumentExtension classes to remain stateless.
GLTFState can be populated by GLTFDocument reading a file or by converting a Godot scene. Then the data can either be used to create a Godot scene or save to a GLTF file. The code that converts to/from a Godot scene can be intercepted at arbitrary points by GLTFDocumentExtension classes. This allows for custom data to be stored in the GLTF file or for custom data to be converted to/from Godot nodes.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
Constants¶
HANDLE_BINARY_DISCARD_TEXTURES = 0
Discards all embedded textures and uses untextured materials.
HANDLE_BINARY_EXTRACT_TEXTURES = 1
Extracts embedded textures to be reimported and compressed. Editor only. Acts as uncompressed at runtime.
HANDLE_BINARY_EMBED_AS_BASISU = 2
Embeds textures VRAM compressed with Basis Universal into the generated scene.
HANDLE_BINARY_EMBED_AS_UNCOMPRESSED = 3
Embeds textures compressed losslessly into the generated scene, matching old behavior.
Property Descriptions¶
String base_path = ""
The folder path associated with this GLTF data. This is used to find other files the GLTF file references, like images or binary buffers. This will be set during import when appending from a file, and will be set during export when writing to a file.
PackedByteArray[] buffers = []
void set_buffers ( PackedByteArray[] value )
PackedByteArray[] get_buffers ( )
There is currently no description for this property. Please help us by contributing one!
String copyright = ""
The copyright string in the asset header of the GLTF file. This is set during import if present and export if non-empty. See the GLTF asset header documentation for more information.
bool create_animations = true
There is currently no description for this property. Please help us by contributing one!
String filename = ""
The file name associated with this GLTF data. If it ends with .gltf
, this is text-based GLTF, otherwise this is binary GLB. This will be set during import when appending from a file, and will be set during export when writing to a file. If writing to a buffer, this will be an empty string.