|
@@ -35,37 +35,45 @@ Methods
|
|
.. table::
|
|
.. table::
|
|
:widths: auto
|
|
:widths: auto
|
|
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | void | :ref:`_convert_scene_node<class_GLTFDocumentExtension_method__convert_scene_node>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Node<class_Node>` scene_node **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_export_node<class_GLTFDocumentExtension_method__export_node>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` json, :ref:`Node<class_Node>` node **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_export_post<class_GLTFDocumentExtension_method__export_post>` **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_export_preflight<class_GLTFDocumentExtension_method__export_preflight>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Node<class_Node>` root **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_export_preserialize<class_GLTFDocumentExtension_method__export_preserialize>` **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Node3D<class_Node3D>` | :ref:`_generate_scene_node<class_GLTFDocumentExtension_method__generate_scene_node>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Node<class_Node>` scene_parent **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`String<class_String>` | :ref:`_get_image_file_extension<class_GLTFDocumentExtension_method__get_image_file_extension>` **(** **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_supported_extensions<class_GLTFDocumentExtension_method__get_supported_extensions>` **(** **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_import_node<class_GLTFDocumentExtension_method__import_node>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` json, :ref:`Node<class_Node>` node **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_import_post<class_GLTFDocumentExtension_method__import_post>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Node<class_Node>` root **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_import_post_parse<class_GLTFDocumentExtension_method__import_post_parse>` **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_import_preflight<class_GLTFDocumentExtension_method__import_preflight>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`PackedStringArray<class_PackedStringArray>` extensions **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_parse_image_data<class_GLTFDocumentExtension_method__parse_image_data>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`PackedByteArray<class_PackedByteArray>` image_data, :ref:`String<class_String>` mime_type, :ref:`Image<class_Image>` ret_image **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_parse_node_extensions<class_GLTFDocumentExtension_method__parse_node_extensions>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` extensions **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_parse_texture_json<class_GLTFDocumentExtension_method__parse_texture_json>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Dictionary<class_Dictionary>` texture_json, :ref:`GLTFTexture<class_GLTFTexture>` ret_gltf_texture **)** |virtual| |
|
|
|
|
- +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | void | :ref:`_convert_scene_node<class_GLTFDocumentExtension_method__convert_scene_node>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Node<class_Node>` scene_node **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_export_node<class_GLTFDocumentExtension_method__export_node>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` json, :ref:`Node<class_Node>` node **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_export_post<class_GLTFDocumentExtension_method__export_post>` **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_export_preflight<class_GLTFDocumentExtension_method__export_preflight>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Node<class_Node>` root **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_export_preserialize<class_GLTFDocumentExtension_method__export_preserialize>` **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Node3D<class_Node3D>` | :ref:`_generate_scene_node<class_GLTFDocumentExtension_method__generate_scene_node>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Node<class_Node>` scene_parent **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`String<class_String>` | :ref:`_get_image_file_extension<class_GLTFDocumentExtension_method__get_image_file_extension>` **(** **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_saveable_image_formats<class_GLTFDocumentExtension_method__get_saveable_image_formats>` **(** **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_supported_extensions<class_GLTFDocumentExtension_method__get_supported_extensions>` **(** **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_import_node<class_GLTFDocumentExtension_method__import_node>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` json, :ref:`Node<class_Node>` node **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_import_post<class_GLTFDocumentExtension_method__import_post>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Node<class_Node>` root **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_import_post_parse<class_GLTFDocumentExtension_method__import_post_parse>` **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_import_preflight<class_GLTFDocumentExtension_method__import_preflight>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`PackedStringArray<class_PackedStringArray>` extensions **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_parse_image_data<class_GLTFDocumentExtension_method__parse_image_data>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`PackedByteArray<class_PackedByteArray>` image_data, :ref:`String<class_String>` mime_type, :ref:`Image<class_Image>` ret_image **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_parse_node_extensions<class_GLTFDocumentExtension_method__parse_node_extensions>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` extensions **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_parse_texture_json<class_GLTFDocumentExtension_method__parse_texture_json>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Dictionary<class_Dictionary>` texture_json, :ref:`GLTFTexture<class_GLTFTexture>` ret_gltf_texture **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_save_image_at_path<class_GLTFDocumentExtension_method__save_image_at_path>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Image<class_Image>` image, :ref:`String<class_String>` file_path, :ref:`String<class_String>` image_format, :ref:`float<class_float>` lossy_quality **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`_serialize_image_to_bytes<class_GLTFDocumentExtension_method__serialize_image_to_bytes>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Image<class_Image>` image, :ref:`Dictionary<class_Dictionary>` image_dict, :ref:`String<class_String>` image_format, :ref:`float<class_float>` lossy_quality **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`_serialize_texture_json<class_GLTFDocumentExtension_method__serialize_texture_json>` **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Dictionary<class_Dictionary>` texture_json, :ref:`GLTFTexture<class_GLTFTexture>` gltf_texture, :ref:`String<class_String>` image_format **)** |virtual| |
|
|
|
|
+ +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
|
|
.. rst-class:: classref-section-separator
|
|
.. rst-class:: classref-section-separator
|
|
|
|
|
|
@@ -96,7 +104,7 @@ Runs when converting the data from a Godot scene node. This method can be used t
|
|
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_export_node** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` json, :ref:`Node<class_Node>` node **)** |virtual|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_export_node** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` json, :ref:`Node<class_Node>` node **)** |virtual|
|
|
|
|
|
|
-Part of the export process. This method is run after :ref:`_export_preserialize<class_GLTFDocumentExtension_method__export_preserialize>` and before :ref:`_export_post<class_GLTFDocumentExtension_method__export_post>`.
|
|
|
|
|
|
+Part of the export process. This method is run after :ref:`_get_saveable_image_formats<class_GLTFDocumentExtension_method__get_saveable_image_formats>` and before :ref:`_export_post<class_GLTFDocumentExtension_method__export_post>`. If this **GLTFDocumentExtension** is used for exporting images, this runs after :ref:`_serialize_texture_json<class_GLTFDocumentExtension_method__serialize_texture_json>`.
|
|
|
|
|
|
This method can be used to modify the final JSON of each node.
|
|
This method can be used to modify the final JSON of each node.
|
|
|
|
|
|
@@ -138,7 +146,7 @@ The return value is used to determine if this **GLTFDocumentExtension** instance
|
|
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_export_preserialize** **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_export_preserialize** **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual|
|
|
|
|
|
|
-Part of the export process. This method is run after :ref:`_convert_scene_node<class_GLTFDocumentExtension_method__convert_scene_node>` and before :ref:`_export_node<class_GLTFDocumentExtension_method__export_node>`.
|
|
|
|
|
|
+Part of the export process. This method is run after :ref:`_convert_scene_node<class_GLTFDocumentExtension_method__convert_scene_node>` and before :ref:`_get_saveable_image_formats<class_GLTFDocumentExtension_method__get_saveable_image_formats>`.
|
|
|
|
|
|
This method can be used to alter the state before performing serialization. It runs every time when generating a buffer with :ref:`GLTFDocument.generate_buffer<class_GLTFDocument_method_generate_buffer>` or writing to the file system with :ref:`GLTFDocument.write_to_filesystem<class_GLTFDocument_method_write_to_filesystem>`.
|
|
This method can be used to alter the state before performing serialization. It runs every time when generating a buffer with :ref:`GLTFDocument.generate_buffer<class_GLTFDocument_method_generate_buffer>` or writing to the file system with :ref:`GLTFDocument.write_to_filesystem<class_GLTFDocument_method_write_to_filesystem>`.
|
|
|
|
|
|
@@ -152,7 +160,7 @@ This method can be used to alter the state before performing serialization. It r
|
|
|
|
|
|
:ref:`Node3D<class_Node3D>` **_generate_scene_node** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Node<class_Node>` scene_parent **)** |virtual|
|
|
:ref:`Node3D<class_Node3D>` **_generate_scene_node** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Node<class_Node>` scene_parent **)** |virtual|
|
|
|
|
|
|
-Part of the import process. This method is run after :ref:`_parse_node_extensions<class_GLTFDocumentExtension_method__parse_node_extensions>` and before :ref:`_import_post_parse<class_GLTFDocumentExtension_method__import_post_parse>`.
|
|
|
|
|
|
+Part of the import process. This method is run after :ref:`_import_post_parse<class_GLTFDocumentExtension_method__import_post_parse>` and before :ref:`_import_node<class_GLTFDocumentExtension_method__import_node>`.
|
|
|
|
|
|
Runs when generating a Godot scene node from a GLTFNode. The returned node will be added to the scene tree. Multiple nodes can be generated in this step if they are added as a child of the returned node.
|
|
Runs when generating a Godot scene node from a GLTFNode. The returned node will be added to the scene tree. Multiple nodes can be generated in this step if they are added as a child of the returned node.
|
|
|
|
|
|
@@ -172,6 +180,20 @@ Returns the file extension to use for saving image data into, for example, ``".p
|
|
|
|
|
|
----
|
|
----
|
|
|
|
|
|
|
|
+.. _class_GLTFDocumentExtension_method__get_saveable_image_formats:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`PackedStringArray<class_PackedStringArray>` **_get_saveable_image_formats** **(** **)** |virtual|
|
|
|
|
+
|
|
|
|
+Part of the export process. This method is run after :ref:`_convert_scene_node<class_GLTFDocumentExtension_method__convert_scene_node>` and before :ref:`_export_node<class_GLTFDocumentExtension_method__export_node>`.
|
|
|
|
+
|
|
|
|
+Returns an array of the image formats that can be saved/exported by this extension. This extension will only be selected as the image exporter if the :ref:`GLTFDocument<class_GLTFDocument>`'s :ref:`GLTFDocument.image_format<class_GLTFDocument_property_image_format>` is in this array. If this **GLTFDocumentExtension** is selected as the image exporter, one of the :ref:`_save_image_at_path<class_GLTFDocumentExtension_method__save_image_at_path>` or :ref:`_serialize_image_to_bytes<class_GLTFDocumentExtension_method__serialize_image_to_bytes>` methods will run next, otherwise :ref:`_export_node<class_GLTFDocumentExtension_method__export_node>` will run next. If the format name contains ``"Lossy"``, the lossy quality slider will be displayed.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
.. _class_GLTFDocumentExtension_method__get_supported_extensions:
|
|
.. _class_GLTFDocumentExtension_method__get_supported_extensions:
|
|
|
|
|
|
.. rst-class:: classref-method
|
|
.. rst-class:: classref-method
|
|
@@ -192,7 +214,7 @@ Returns an array of the GLTF extensions supported by this GLTFDocumentExtension
|
|
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_import_node** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` json, :ref:`Node<class_Node>` node **)** |virtual|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_import_node** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` json, :ref:`Node<class_Node>` node **)** |virtual|
|
|
|
|
|
|
-Part of the import process. This method is run after :ref:`_import_post_parse<class_GLTFDocumentExtension_method__import_post_parse>` and before :ref:`_import_post<class_GLTFDocumentExtension_method__import_post>`.
|
|
|
|
|
|
+Part of the import process. This method is run after :ref:`_generate_scene_node<class_GLTFDocumentExtension_method__generate_scene_node>` and before :ref:`_import_post<class_GLTFDocumentExtension_method__import_post>`.
|
|
|
|
|
|
This method can be used to make modifications to each of the generated Godot scene nodes.
|
|
This method can be used to make modifications to each of the generated Godot scene nodes.
|
|
|
|
|
|
@@ -220,7 +242,7 @@ This method can be used to modify the final Godot scene generated by the import
|
|
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_import_post_parse** **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_import_post_parse** **(** :ref:`GLTFState<class_GLTFState>` state **)** |virtual|
|
|
|
|
|
|
-Part of the import process. This method is run after :ref:`_generate_scene_node<class_GLTFDocumentExtension_method__generate_scene_node>` and before :ref:`_import_node<class_GLTFDocumentExtension_method__import_node>`.
|
|
|
|
|
|
+Part of the import process. This method is run after :ref:`_parse_node_extensions<class_GLTFDocumentExtension_method__parse_node_extensions>` and before :ref:`_generate_scene_node<class_GLTFDocumentExtension_method__generate_scene_node>`.
|
|
|
|
|
|
This method can be used to modify any of the data imported so far, including any scene nodes, before running the final per-node import step.
|
|
This method can be used to modify any of the data imported so far, including any scene nodes, before running the final per-node import step.
|
|
|
|
|
|
@@ -262,7 +284,7 @@ Runs when parsing image data from a GLTF file. The data could be sourced from a
|
|
|
|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_parse_node_extensions** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` extensions **)** |virtual|
|
|
:ref:`Error<enum_@GlobalScope_Error>` **_parse_node_extensions** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`GLTFNode<class_GLTFNode>` gltf_node, :ref:`Dictionary<class_Dictionary>` extensions **)** |virtual|
|
|
|
|
|
|
-Part of the import process. This method is run after :ref:`_get_supported_extensions<class_GLTFDocumentExtension_method__get_supported_extensions>` and before :ref:`_generate_scene_node<class_GLTFDocumentExtension_method__generate_scene_node>`.
|
|
|
|
|
|
+Part of the import process. This method is run after :ref:`_get_supported_extensions<class_GLTFDocumentExtension_method__get_supported_extensions>` and before :ref:`_import_post_parse<class_GLTFDocumentExtension_method__import_post_parse>`.
|
|
|
|
|
|
Runs when parsing the node extensions of a GLTFNode. This method can be used to process the extension JSON data into a format that can be used by :ref:`_generate_scene_node<class_GLTFDocumentExtension_method__generate_scene_node>`. The return value should be a member of the :ref:`Error<enum_@GlobalScope_Error>` enum.
|
|
Runs when parsing the node extensions of a GLTFNode. This method can be used to process the extension JSON data into a format that can be used by :ref:`_generate_scene_node<class_GLTFDocumentExtension_method__generate_scene_node>`. The return value should be a member of the :ref:`Error<enum_@GlobalScope_Error>` enum.
|
|
|
|
|
|
@@ -280,6 +302,50 @@ Part of the import process. This method is run after :ref:`_parse_image_data<cla
|
|
|
|
|
|
Runs when parsing the texture JSON from the GLTF textures array. This can be used to set the source image index to use as the texture.
|
|
Runs when parsing the texture JSON from the GLTF textures array. This can be used to set the source image index to use as the texture.
|
|
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_GLTFDocumentExtension_method__save_image_at_path:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Error<enum_@GlobalScope_Error>` **_save_image_at_path** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Image<class_Image>` image, :ref:`String<class_String>` file_path, :ref:`String<class_String>` image_format, :ref:`float<class_float>` lossy_quality **)** |virtual|
|
|
|
|
+
|
|
|
|
+Part of the export process. This method is run after :ref:`_get_saveable_image_formats<class_GLTFDocumentExtension_method__get_saveable_image_formats>` and before :ref:`_serialize_texture_json<class_GLTFDocumentExtension_method__serialize_texture_json>`.
|
|
|
|
+
|
|
|
|
+This method is run when saving images separately from the GLTF file. When images are embedded, :ref:`_serialize_image_to_bytes<class_GLTFDocumentExtension_method__serialize_image_to_bytes>` runs instead. Note that these methods only run when this **GLTFDocumentExtension** is selected as the image exporter.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_GLTFDocumentExtension_method__serialize_image_to_bytes:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`PackedByteArray<class_PackedByteArray>` **_serialize_image_to_bytes** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Image<class_Image>` image, :ref:`Dictionary<class_Dictionary>` image_dict, :ref:`String<class_String>` image_format, :ref:`float<class_float>` lossy_quality **)** |virtual|
|
|
|
|
+
|
|
|
|
+Part of the export process. This method is run after :ref:`_get_saveable_image_formats<class_GLTFDocumentExtension_method__get_saveable_image_formats>` and before :ref:`_serialize_texture_json<class_GLTFDocumentExtension_method__serialize_texture_json>`.
|
|
|
|
+
|
|
|
|
+This method is run when embedding images in the GLTF file. When images are saved separately, :ref:`_save_image_at_path<class_GLTFDocumentExtension_method__save_image_at_path>` runs instead. Note that these methods only run when this **GLTFDocumentExtension** is selected as the image exporter.
|
|
|
|
+
|
|
|
|
+This method must set the image MIME type in the ``image_dict`` with the ``"mimeType"`` key. For example, for a PNG image, it would be set to ``"image/png"``. The return value must be a :ref:`PackedByteArray<class_PackedByteArray>` containing the image data.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_GLTFDocumentExtension_method__serialize_texture_json:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Error<enum_@GlobalScope_Error>` **_serialize_texture_json** **(** :ref:`GLTFState<class_GLTFState>` state, :ref:`Dictionary<class_Dictionary>` texture_json, :ref:`GLTFTexture<class_GLTFTexture>` gltf_texture, :ref:`String<class_String>` image_format **)** |virtual|
|
|
|
|
+
|
|
|
|
+Part of the export process. This method is run after :ref:`_save_image_at_path<class_GLTFDocumentExtension_method__save_image_at_path>` or :ref:`_serialize_image_to_bytes<class_GLTFDocumentExtension_method__serialize_image_to_bytes>`, and before :ref:`_export_node<class_GLTFDocumentExtension_method__export_node>`. Note that this method only runs when this **GLTFDocumentExtension** is selected as the image exporter.
|
|
|
|
+
|
|
|
|
+This method can be used to set up the extensions for the texture JSON by editing ``texture_json``. The extension must also be added as used extension with :ref:`GLTFState.add_used_extension<class_GLTFState_method_add_used_extension>`, be sure to set ``required`` to ``true`` if you are not providing a fallback.
|
|
|
|
+
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|