GLTFState

Inherits: Resource < Reference < Object

Represents all data of a GLTF file.

Description

Note: This class is only compiled in editor builds. Run-time glTF loading and saving is not available in exported projects. References to GLTFState within a script will cause an error in an exported project.

Properties

Array

buffers

[  ]

bool

create_animations

true

PoolByteArray

glb_data

PoolByteArray(  )

Dictionary

json

{}

int

major_version

0

int

minor_version

0

Array

root_nodes

[  ]

String

scene_name

""

bool

use_named_skin_binds

false

Methods

void

add_used_extension ( String extension_name, bool required )

Array

get_accessors ( )

Variant

get_additional_data ( String extension_name )

AnimationPlayer

get_animation_player ( int idx )

int

get_animation_players_count ( int idx )

Array

get_animations ( )

Array

get_buffer_views ( )

Array

get_cameras ( )

Array

get_images ( )

Array

get_lights ( )

Array

get_materials ( )

Array

get_meshes ( )

Array

get_nodes ( )

Node

get_scene_node ( int idx )

Dictionary

get_skeleton_to_node ( )

Array

get_skeletons ( )

Array

get_skins ( )

Array

get_texture_samplers ( )

Array

get_textures ( )

Array

get_unique_animation_names ( )

Array

get_unique_names ( )

void

set_accessors ( Array accessors )

void

set_additional_data ( String extension_name, Variant additional_data )

void

set_animations ( Array animations )

void

set_buffer_views ( Array buffer_views )

void

set_cameras ( Array cameras )

void

set_images ( Array images )

void

set_lights ( Array lights )

void

set_materials ( Array materials )

void

set_meshes ( Array meshes )

void

set_nodes ( Array nodes )

void

set_skeleton_to_node ( Dictionary skeleton_to_node )

void

set_skeletons ( Array skeletons )

void

set_skins ( Array skins )

void

set_texture_samplers ( Array texture_samplers )

void

set_textures ( Array textures )

void

set_unique_animation_names ( Array unique_animation_names )

void

set_unique_names ( Array unique_names )


Property Descriptions

Array buffers = [  ]

  • void set_buffers ( Array value )

  • Array get_buffers ( )

There is currently no description for this property. Please help us by contributing one!


bool create_animations = true

  • void set_create_animations ( bool value )

  • bool get_create_animations ( )

There is currently no description for this property. Please help us by contributing one!


PoolByteArray glb_data = PoolByteArray(  )

There is currently no description for this property. Please help us by contributing one!


Dictionary json = {}

There is currently no description for this property. Please help us by contributing one!


int major_version = 0

  • void set_major_version ( int value )

  • int get_major_version ( )

There is currently no description for this property. Please help us by contributing one!


int minor_version = 0

  • void set_minor_version ( int value )

  • int get_minor_version ( )

There is currently no description for this property. Please help us by contributing one!


Array root_nodes = [  ]

  • void set_root_nodes ( Array value )

  • Array get_root_nodes ( )

The root nodes of the GLTF file. Typically, a GLTF file will only have one scene, and therefore one root node. However, a GLTF file may have multiple scenes and therefore multiple root nodes, which will be generated as siblings of each other and as children of the root node of the generated Redot scene.


String scene_name = ""

  • void set_scene_name ( String value )

  • String get_scene_name ( )

The name of the scene. When importing, if not specified, this will be the file name. When exporting, if specified, the scene name will be saved to the GLTF file.


bool use_named_skin_binds = false

  • void set_use_named_skin_binds ( bool value )

  • bool get_use_named_skin_binds ( )

There is currently no description for this property. Please help us by contributing one!


Method Descriptions

void add_used_extension ( String extension_name, bool required )

Appends an extension to the list of extensions used by this GLTF file during serialization. If required is true, the extension will also be added to the list of required extensions. Do not run this in GLTFDocumentExtension._export_post, as that stage is too late to add extensions. The final list is sorted alphabetically.


Array get_accessors ( )

There is currently no description for this method. Please help us by contributing one!


Variant get_additional_data ( String extension_name )

Gets additional arbitrary data in this GLTFState instance. This can be used to keep per-file state data in GLTFDocumentExtension classes, which is important because they are stateless.

The argument should be the GLTFDocumentExtension name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null.


AnimationPlayer get_animation_player ( int idx )

There is currently no description for this method. Please help us by contributing one!


int get_animation_players_count ( int idx )

There is currently no description for this method. Please help us by contributing one!


Array get_animations ( )

Returns an array of all GLTFAnimations in the GLTF file. When importing, these will be generated as animations in an AnimationPlayer node. When exporting, these will be generated from Redot AnimationPlayer nodes.


Array get_buffer_views ( )

There is currently no description for this method. Please help us by contributing one!


Array get_cameras ( )

Returns an array of all GLTFCameras in the GLTF file. These are the cameras that the GLTFNode.camera index refers to.


Array get_images ( )

There is currently no description for this method. Please help us by contributing one!


Array get_lights ( )

Returns an array of all GLTFLights in the GLTF file. These are the lights that the GLTFNode.light index refers to.


Array get_materials ( )

There is currently no description for this method. Please help us by contributing one!


Array get_meshes ( )

Returns an array of all GLTFMeshes in the GLTF file. These are the meshes that the GLTFNode.mesh index refers to.


Array get_nodes ( )

Returns an array of all GLTFNodes in the GLTF file. These are the nodes that GLTFNode.children and root_nodes refer to. This includes nodes that may not be generated in the Redot scene, or nodes that may generate multiple Redot scene nodes.


Node get_scene_node ( int idx )

There is currently no description for this method. Please help us by contributing one!


Dictionary get_skeleton_to_node ( )

There is currently no description for this method. Please help us by contributing one!


Array get_skeletons ( )

Returns an array of all GLTFSkeletons in the GLTF file. These are the skeletons that the GLTFNode.skeleton index refers to.


Array get_skins ( )

Returns an array of all GLTFSkins in the GLTF file. These are the skins that the GLTFNode.skin index refers to.


Array get_texture_samplers ( )

Retrieves the array of texture samplers that are used by the textures contained in the GLTF.


Array get_textures ( )

There is currently no description for this method. Please help us by contributing one!


Array get_unique_animation_names ( )

Returns an array of unique animation names. This is only used during the import process.


Array get_unique_names ( )

Returns an array of unique node names. This is used in both the import process and export process.


void set_accessors ( Array accessors )

There is currently no description for this method. Please help us by contributing one!


void set_additional_data ( String extension_name, Variant additional_data )

Sets additional arbitrary data in this GLTFState instance. This can be used to keep per-file state data in GLTFDocumentExtension classes, which is important because they are stateless.

The first argument should be the GLTFDocumentExtension name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want.


void set_animations ( Array animations )

There is currently no description for this method. Please help us by contributing one!


void set_buffer_views ( Array buffer_views )

There is currently no description for this method. Please help us by contributing one!


void set_cameras ( Array cameras )

There is currently no description for this method. Please help us by contributing one!


void set_images ( Array images )

There is currently no description for this method. Please help us by contributing one!


void set_lights ( Array lights )

There is currently no description for this method. Please help us by contributing one!


void set_materials ( Array materials )

There is currently no description for this method. Please help us by contributing one!


void set_meshes ( Array meshes )

There is currently no description for this method. Please help us by contributing one!


void set_nodes ( Array nodes )

There is currently no description for this method. Please help us by contributing one!


void set_skeleton_to_node ( Dictionary skeleton_to_node )

There is currently no description for this method. Please help us by contributing one!


void set_skeletons ( Array skeletons )

There is currently no description for this method. Please help us by contributing one!


void set_skins ( Array skins )

There is currently no description for this method. Please help us by contributing one!


void set_texture_samplers ( Array texture_samplers )

Sets the array of texture samplers that are used by the textures contained in the GLTF.


void set_textures ( Array textures )

There is currently no description for this method. Please help us by contributing one!


void set_unique_animation_names ( Array unique_animation_names )

There is currently no description for this method. Please help us by contributing one!


void set_unique_names ( Array unique_names )

There is currently no description for this method. Please help us by contributing one!