mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with latest 4.0-dev
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the EditorImportPlugin.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
@@ -16,9 +16,9 @@ Registers a custom resource importer in the editor. Use the class to parse any f
|
||||
Description
|
||||
-----------
|
||||
|
||||
EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your :ref:`EditorPlugin<class_EditorPlugin>` with :ref:`EditorPlugin.add_import_plugin<class_EditorPlugin_method_add_import_plugin>`.
|
||||
``EditorImportPlugin``\ s provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers.
|
||||
|
||||
EditorImportPlugins work by associating with specific file extensions and a resource type. See :ref:`_get_recognized_extensions<class_EditorImportPlugin_method__get_recognized_extensions>` and :ref:`_get_resource_type<class_EditorImportPlugin_method__get_resource_type>`. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the ``.godot/imported`` directory.
|
||||
EditorImportPlugins work by associating with specific file extensions and a resource type. See :ref:`_get_recognized_extensions<class_EditorImportPlugin_method__get_recognized_extensions>` and :ref:`_get_resource_type<class_EditorImportPlugin_method__get_resource_type>`. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the ``.godot/imported`` directory (see :ref:`ProjectSettings.application/config/use_hidden_project_data_directory<class_ProjectSettings_property_application/config/use_hidden_project_data_directory>`).
|
||||
|
||||
Below is an example EditorImportPlugin that imports a :ref:`Mesh<class_Mesh>` from a file with the extension ".special" or ".spec":
|
||||
|
||||
@@ -128,6 +128,8 @@ Below is an example EditorImportPlugin that imports a :ref:`Mesh<class_Mesh>` fr
|
||||
|
||||
|
||||
|
||||
To use ``EditorImportPlugin``, register it using the :ref:`EditorPlugin.add_import_plugin<class_EditorPlugin_method_add_import_plugin>` method first.
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
@@ -137,13 +139,13 @@ Methods
|
||||
-------
|
||||
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`_get_import_options<class_EditorImportPlugin_method__get_import_options>` **(** :ref:`int<class_int>` preset_index **)** |virtual| |const| |
|
||||
| :ref:`Array<class_Array>` | :ref:`_get_import_options<class_EditorImportPlugin_method__get_import_options>` **(** :ref:`String<class_String>` path, :ref:`int<class_int>` preset_index **)** |virtual| |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_get_import_order<class_EditorImportPlugin_method__get_import_order>` **(** **)** |virtual| |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`_get_importer_name<class_EditorImportPlugin_method__get_importer_name>` **(** **)** |virtual| |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_get_option_visibility<class_EditorImportPlugin_method__get_option_visibility>` **(** :ref:`StringName<class_StringName>` option_name, :ref:`Dictionary<class_Dictionary>` options **)** |virtual| |const| |
|
||||
| :ref:`bool<class_bool>` | :ref:`_get_option_visibility<class_EditorImportPlugin_method__get_option_visibility>` **(** :ref:`String<class_String>` path, :ref:`StringName<class_StringName>` option_name, :ref:`Dictionary<class_Dictionary>` options **)** |virtual| |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_get_preset_count<class_EditorImportPlugin_method__get_preset_count>` **(** **)** |virtual| |const| |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
@@ -167,7 +169,7 @@ Method Descriptions
|
||||
|
||||
.. _class_EditorImportPlugin_method__get_import_options:
|
||||
|
||||
- :ref:`Array<class_Array>` **_get_import_options** **(** :ref:`int<class_int>` preset_index **)** |virtual| |const|
|
||||
- :ref:`Array<class_Array>` **_get_import_options** **(** :ref:`String<class_String>` path, :ref:`int<class_int>` preset_index **)** |virtual| |const|
|
||||
|
||||
Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: ``name``, ``default_value``, ``property_hint`` (optional), ``hint_string`` (optional), ``usage`` (optional).
|
||||
|
||||
@@ -191,7 +193,7 @@ Gets the unique name of the importer.
|
||||
|
||||
.. _class_EditorImportPlugin_method__get_option_visibility:
|
||||
|
||||
- :ref:`bool<class_bool>` **_get_option_visibility** **(** :ref:`StringName<class_StringName>` option_name, :ref:`Dictionary<class_Dictionary>` options **)** |virtual| |const|
|
||||
- :ref:`bool<class_bool>` **_get_option_visibility** **(** :ref:`String<class_String>` path, :ref:`StringName<class_StringName>` option_name, :ref:`Dictionary<class_Dictionary>` options **)** |virtual| |const|
|
||||
|
||||
This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example:
|
||||
|
||||
@@ -270,7 +272,7 @@ Gets the Godot resource type associated with this loader. e.g. ``"Mesh"`` or ``"
|
||||
|
||||
- :ref:`String<class_String>` **_get_save_extension** **(** **)** |virtual| |const|
|
||||
|
||||
Gets the extension used to save this resource in the ``.godot/imported`` directory.
|
||||
Gets the extension used to save this resource in the ``.godot/imported`` directory (see :ref:`ProjectSettings.application/config/use_hidden_project_data_directory<class_ProjectSettings_property_application/config/use_hidden_project_data_directory>`).
|
||||
|
||||
----
|
||||
|
||||
|
||||
Reference in New Issue
Block a user