:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/4.1/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/4.1/doc/classes/EditorExportPlugin.xml. .. _class_EditorExportPlugin: EditorExportPlugin ================== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` A script that is executed when exporting the project. .. rst-class:: classref-introduction-group Description ----------- **EditorExportPlugin**\ s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, :ref:`_export_begin` is called at the beginning of the export process and then :ref:`_export_file` is called for each exported file. To use **EditorExportPlugin**, register it using the :ref:`EditorPlugin.add_export_plugin` method first. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_begin_customize_resources` **(** :ref:`EditorExportPlatform` platform, :ref:`PackedStringArray` features **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_begin_customize_scenes` **(** :ref:`EditorExportPlatform` platform, :ref:`PackedStringArray` features **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Resource` | :ref:`_customize_resource` **(** :ref:`Resource` resource, :ref:`String` path **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Node` | :ref:`_customize_scene` **(** :ref:`Node` scene, :ref:`String` path **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_end_customize_resources` **(** **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_end_customize_scenes` **(** **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_export_begin` **(** :ref:`PackedStringArray` features, :ref:`bool` is_debug, :ref:`String` path, :ref:`int` flags **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_export_end` **(** **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_export_file` **(** :ref:`String` path, :ref:`String` type, :ref:`PackedStringArray` features **)** |virtual| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_customization_configuration_hash` **(** **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`_get_export_features` **(** :ref:`EditorExportPlatform` platform, :ref:`bool` debug **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary[]` | :ref:`_get_export_options` **(** :ref:`EditorExportPlatform` platform **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`_get_name` **(** **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_should_update_export_options` **(** :ref:`EditorExportPlatform` platform **)** |virtual| |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_file` **(** :ref:`String` path, :ref:`PackedByteArray` file, :ref:`bool` remap **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_ios_bundle_file` **(** :ref:`String` path **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_ios_cpp_code` **(** :ref:`String` code **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_ios_embedded_framework` **(** :ref:`String` path **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_ios_framework` **(** :ref:`String` path **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_ios_linker_flags` **(** :ref:`String` flags **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_ios_plist_content` **(** :ref:`String` plist_content **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_ios_project_static_lib` **(** :ref:`String` path **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_macos_plugin_file` **(** :ref:`String` path **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_shared_object` **(** :ref:`String` path, :ref:`PackedStringArray` tags, :ref:`String` target **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_option` **(** :ref:`StringName` name **)** |const| | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`skip` **(** **)** | +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_EditorExportPlugin_method__begin_customize_resources: .. rst-class:: classref-method :ref:`bool` **_begin_customize_resources** **(** :ref:`EditorExportPlatform` platform, :ref:`PackedStringArray` features **)** |virtual| |const| Return ``true`` if this plugin will customize resources based on the platform and features used. When enabled, :ref:`_get_customization_configuration_hash`, :ref:`_customize_resource` and :ref:`_customize_scene` will be called and must be implemented. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__begin_customize_scenes: .. rst-class:: classref-method :ref:`bool` **_begin_customize_scenes** **(** :ref:`EditorExportPlatform` platform, :ref:`PackedStringArray` features **)** |virtual| |const| Return true if this plugin will customize scenes based on the platform and features used. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__customize_resource: .. rst-class:: classref-method :ref:`Resource` **_customize_resource** **(** :ref:`Resource` resource, :ref:`String` path **)** |virtual| Customize a resource. If changes are made to it, return the same or a new resource. Otherwise, return ``null``. The *path* argument is only used when customizing an actual file, otherwise this means that this resource is part of another one and it will be empty. Implementing this method is required if :ref:`_begin_customize_resources` returns ``true``. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__customize_scene: .. rst-class:: classref-method :ref:`Node` **_customize_scene** **(** :ref:`Node` scene, :ref:`String` path **)** |virtual| Customize a scene. If changes are made to it, return the same or a new scene. Otherwise, return ``null``. If a new scene is returned, it is up to you to dispose of the old one. Implementing this method is required if :ref:`_begin_customize_scenes` returns ``true``. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__end_customize_resources: .. rst-class:: classref-method void **_end_customize_resources** **(** **)** |virtual| This is called when the customization process for resources ends. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__end_customize_scenes: .. rst-class:: classref-method void **_end_customize_scenes** **(** **)** |virtual| This is called when the customization process for scenes ends. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__export_begin: .. rst-class:: classref-method void **_export_begin** **(** :ref:`PackedStringArray` features, :ref:`bool` is_debug, :ref:`String` path, :ref:`int` flags **)** |virtual| Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export. ``features`` is the list of features for the export, ``is_debug`` is ``true`` for debug builds, ``path`` is the target path for the exported project. ``flags`` is only used when running a runnable profile, e.g. when using native run on Android. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__export_end: .. rst-class:: classref-method void **_export_end** **(** **)** |virtual| Virtual method to be overridden by the user. Called when the export is finished. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__export_file: .. rst-class:: classref-method void **_export_file** **(** :ref:`String` path, :ref:`String` type, :ref:`PackedStringArray` features **)** |virtual| Virtual method to be overridden by the user. Called for each exported file, providing arguments that can be used to identify the file. ``path`` is the path of the file, ``type`` is the :ref:`Resource` represented by the file (e.g. :ref:`PackedScene`) and ``features`` is the list of features for the export. Calling :ref:`skip` inside this callback will make the file not included in the export. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__get_customization_configuration_hash: .. rst-class:: classref-method :ref:`int` **_get_customization_configuration_hash** **(** **)** |virtual| |const| Return a hash based on the configuration passed (for both scenes and resources). This helps keep separate caches for separate export configurations. Implementing this method is required if :ref:`_begin_customize_resources` returns ``true``. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__get_export_features: .. rst-class:: classref-method :ref:`PackedStringArray` **_get_export_features** **(** :ref:`EditorExportPlatform` platform, :ref:`bool` debug **)** |virtual| |const| Return a :ref:`PackedStringArray` of additional features this preset, for the given ``platform``, should have. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__get_export_options: .. rst-class:: classref-method :ref:`Dictionary[]` **_get_export_options** **(** :ref:`EditorExportPlatform` platform **)** |virtual| |const| Return a list of export options that can be configured for this export plugin. Each element in the return value is a :ref:`Dictionary` with the following keys: - ``option``: A dictionary with the structure documented by :ref:`Object.get_property_list`, but all keys are optional. - ``default_value``: The default value for this option. - ``update_visibility``: An optional boolean value. If set to ``true``, the preset will emit :ref:`Object.property_list_changed` when the option is changed. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__get_name: .. rst-class:: classref-method :ref:`String` **_get_name** **(** **)** |virtual| |const| Return the name identifier of this plugin (for future identification by the exporter). The plugins are sorted by name before exporting. Implementing this method is required. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method__should_update_export_options: .. rst-class:: classref-method :ref:`bool` **_should_update_export_options** **(** :ref:`EditorExportPlatform` platform **)** |virtual| |const| Return ``true``, if the result of :ref:`_get_export_options` has changed and the export options of preset corresponding to ``platform`` should be updated. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_file: .. rst-class:: classref-method void **add_file** **(** :ref:`String` path, :ref:`PackedByteArray` file, :ref:`bool` remap **)** Adds a custom file to be exported. ``path`` is the virtual path that can be used to load the file, ``file`` is the binary data of the file. When called inside :ref:`_export_file` and ``remap`` is ``true``, the current file will not be exported, but instead remapped to this custom file. ``remap`` is ignored when called in other places. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_ios_bundle_file: .. rst-class:: classref-method void **add_ios_bundle_file** **(** :ref:`String` path **)** Adds an iOS bundle file from the given ``path`` to the exported project. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_ios_cpp_code: .. rst-class:: classref-method void **add_ios_cpp_code** **(** :ref:`String` code **)** Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_ios_embedded_framework: .. rst-class:: classref-method void **add_ios_embedded_framework** **(** :ref:`String` path **)** Adds a dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary. \ **Note:** For static libraries (\*.a) works in same way as ``add_ios_framework``. This method should not be used for System libraries as they are already present on the device. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_ios_framework: .. rst-class:: classref-method void **add_ios_framework** **(** :ref:`String` path **)** Adds a static library (\*.a) or dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_ios_linker_flags: .. rst-class:: classref-method void **add_ios_linker_flags** **(** :ref:`String` flags **)** Adds linker flags for the iOS export. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_ios_plist_content: .. rst-class:: classref-method void **add_ios_plist_content** **(** :ref:`String` plist_content **)** Adds content for iOS Property List files. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_ios_project_static_lib: .. rst-class:: classref-method void **add_ios_project_static_lib** **(** :ref:`String` path **)** Adds a static lib from the given ``path`` to the iOS project. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_macos_plugin_file: .. rst-class:: classref-method void **add_macos_plugin_file** **(** :ref:`String` path **)** Adds file or directory matching ``path`` to ``PlugIns`` directory of macOS app bundle. \ **Note:** This is useful only for macOS exports. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_add_shared_object: .. rst-class:: classref-method void **add_shared_object** **(** :ref:`String` path, :ref:`PackedStringArray` tags, :ref:`String` target **)** Adds a shared object or a directory containing only shared objects with the given ``tags`` and destination ``path``. \ **Note:** In case of macOS exports, those shared objects will be added to ``Frameworks`` directory of app bundle. In case of a directory code-sign will error if you place non code object in directory. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_get_option: .. rst-class:: classref-method :ref:`Variant` **get_option** **(** :ref:`StringName` name **)** |const| Returns the current value of an export option supplied by :ref:`_get_export_options`. .. rst-class:: classref-item-separator ---- .. _class_EditorExportPlugin_method_skip: .. rst-class:: classref-method void **skip** **(** **)** To be called inside :ref:`_export_file`. Skips the current file, so it's not included in the export. .. |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.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`