class_editorexportplugin.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/EditorExportPlugin.xml.
  6. .. _class_EditorExportPlugin:
  7. EditorExportPlugin
  8. ==================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A script that is executed when exporting the project.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **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<class_EditorExportPlugin_method__export_begin>` is called at the beginning of the export process and then :ref:`_export_file<class_EditorExportPlugin_method__export_file>` is called for each exported file.
  15. To use **EditorExportPlugin**, register it using the :ref:`EditorPlugin.add_export_plugin<class_EditorPlugin_method_add_export_plugin>` method first.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`_begin_customize_resources<class_EditorExportPlugin_method__begin_customize_resources>` **(** :ref:`EditorExportPlatform<class_EditorExportPlatform>` platform, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual| |const| |
  23. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`_begin_customize_scenes<class_EditorExportPlugin_method__begin_customize_scenes>` **(** :ref:`EditorExportPlatform<class_EditorExportPlatform>` platform, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual| |const| |
  25. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Resource<class_Resource>` | :ref:`_customize_resource<class_EditorExportPlugin_method__customize_resource>` **(** :ref:`Resource<class_Resource>` resource, :ref:`String<class_String>` path **)** |virtual| |
  27. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Node<class_Node>` | :ref:`_customize_scene<class_EditorExportPlugin_method__customize_scene>` **(** :ref:`Node<class_Node>` scene, :ref:`String<class_String>` path **)** |virtual| |
  29. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`_end_customize_resources<class_EditorExportPlugin_method__end_customize_resources>` **(** **)** |virtual| |
  31. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`_end_customize_scenes<class_EditorExportPlugin_method__end_customize_scenes>` **(** **)** |virtual| |
  33. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`_export_begin<class_EditorExportPlugin_method__export_begin>` **(** :ref:`PackedStringArray<class_PackedStringArray>` features, :ref:`bool<class_bool>` is_debug, :ref:`String<class_String>` path, :ref:`int<class_int>` flags **)** |virtual| |
  35. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`_export_end<class_EditorExportPlugin_method__export_end>` **(** **)** |virtual| |
  37. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`_export_file<class_EditorExportPlugin_method__export_file>` **(** :ref:`String<class_String>` path, :ref:`String<class_String>` type, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual| |
  39. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`_get_customization_configuration_hash<class_EditorExportPlugin_method__get_customization_configuration_hash>` **(** **)** |virtual| |const| |
  41. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_export_features<class_EditorExportPlugin_method__get_export_features>` **(** :ref:`EditorExportPlatform<class_EditorExportPlatform>` platform, :ref:`bool<class_bool>` debug **)** |virtual| |const| |
  43. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`String<class_String>` | :ref:`_get_name<class_EditorExportPlugin_method__get_name>` **(** **)** |virtual| |const| |
  45. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`add_file<class_EditorExportPlugin_method_add_file>` **(** :ref:`String<class_String>` path, :ref:`PackedByteArray<class_PackedByteArray>` file, :ref:`bool<class_bool>` remap **)** |
  47. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | void | :ref:`add_ios_bundle_file<class_EditorExportPlugin_method_add_ios_bundle_file>` **(** :ref:`String<class_String>` path **)** |
  49. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`add_ios_cpp_code<class_EditorExportPlugin_method_add_ios_cpp_code>` **(** :ref:`String<class_String>` code **)** |
  51. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`add_ios_embedded_framework<class_EditorExportPlugin_method_add_ios_embedded_framework>` **(** :ref:`String<class_String>` path **)** |
  53. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`add_ios_framework<class_EditorExportPlugin_method_add_ios_framework>` **(** :ref:`String<class_String>` path **)** |
  55. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`add_ios_linker_flags<class_EditorExportPlugin_method_add_ios_linker_flags>` **(** :ref:`String<class_String>` flags **)** |
  57. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`add_ios_plist_content<class_EditorExportPlugin_method_add_ios_plist_content>` **(** :ref:`String<class_String>` plist_content **)** |
  59. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`add_ios_project_static_lib<class_EditorExportPlugin_method_add_ios_project_static_lib>` **(** :ref:`String<class_String>` path **)** |
  61. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`add_macos_plugin_file<class_EditorExportPlugin_method_add_macos_plugin_file>` **(** :ref:`String<class_String>` path **)** |
  63. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`add_shared_object<class_EditorExportPlugin_method_add_shared_object>` **(** :ref:`String<class_String>` path, :ref:`PackedStringArray<class_PackedStringArray>` tags, :ref:`String<class_String>` target **)** |
  65. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`skip<class_EditorExportPlugin_method_skip>` **(** **)** |
  67. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. .. rst-class:: classref-section-separator
  69. ----
  70. .. rst-class:: classref-descriptions-group
  71. Method Descriptions
  72. -------------------
  73. .. _class_EditorExportPlugin_method__begin_customize_resources:
  74. .. rst-class:: classref-method
  75. :ref:`bool<class_bool>` **_begin_customize_resources** **(** :ref:`EditorExportPlatform<class_EditorExportPlatform>` platform, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual| |const|
  76. Return ``true`` if this plugin will customize resources based on the platform and features used.
  77. When enabled, :ref:`_get_customization_configuration_hash<class_EditorExportPlugin_method__get_customization_configuration_hash>`, :ref:`_customize_resource<class_EditorExportPlugin_method__customize_resource>` and :ref:`_customize_scene<class_EditorExportPlugin_method__customize_scene>` will be called and must be implemented.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_EditorExportPlugin_method__begin_customize_scenes:
  81. .. rst-class:: classref-method
  82. :ref:`bool<class_bool>` **_begin_customize_scenes** **(** :ref:`EditorExportPlatform<class_EditorExportPlatform>` platform, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual| |const|
  83. Return true if this plugin will customize scenes based on the platform and features used.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_EditorExportPlugin_method__customize_resource:
  87. .. rst-class:: classref-method
  88. :ref:`Resource<class_Resource>` **_customize_resource** **(** :ref:`Resource<class_Resource>` resource, :ref:`String<class_String>` path **)** |virtual|
  89. Customize a resource. If changes are made to it, return the same or a new resource. Otherwise, return ``null``.
  90. 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.
  91. Implementing this method is required if :ref:`_begin_customize_resources<class_EditorExportPlugin_method__begin_customize_resources>` returns ``true``.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_EditorExportPlugin_method__customize_scene:
  95. .. rst-class:: classref-method
  96. :ref:`Node<class_Node>` **_customize_scene** **(** :ref:`Node<class_Node>` scene, :ref:`String<class_String>` path **)** |virtual|
  97. 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.
  98. Implementing this method is required if :ref:`_begin_customize_resources<class_EditorExportPlugin_method__begin_customize_resources>` returns ``true``.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_EditorExportPlugin_method__end_customize_resources:
  102. .. rst-class:: classref-method
  103. void **_end_customize_resources** **(** **)** |virtual|
  104. This is called when the customization process for resources ends.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_EditorExportPlugin_method__end_customize_scenes:
  108. .. rst-class:: classref-method
  109. void **_end_customize_scenes** **(** **)** |virtual|
  110. This is called when the customization process for scenes ends.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_EditorExportPlugin_method__export_begin:
  114. .. rst-class:: classref-method
  115. void **_export_begin** **(** :ref:`PackedStringArray<class_PackedStringArray>` features, :ref:`bool<class_bool>` is_debug, :ref:`String<class_String>` path, :ref:`int<class_int>` flags **)** |virtual|
  116. 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.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_EditorExportPlugin_method__export_end:
  120. .. rst-class:: classref-method
  121. void **_export_end** **(** **)** |virtual|
  122. Virtual method to be overridden by the user. Called when the export is finished.
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _class_EditorExportPlugin_method__export_file:
  126. .. rst-class:: classref-method
  127. void **_export_file** **(** :ref:`String<class_String>` path, :ref:`String<class_String>` type, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual|
  128. 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<class_Resource>` represented by the file (e.g. :ref:`PackedScene<class_PackedScene>`) and ``features`` is the list of features for the export.
  129. Calling :ref:`skip<class_EditorExportPlugin_method_skip>` inside this callback will make the file not included in the export.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_EditorExportPlugin_method__get_customization_configuration_hash:
  133. .. rst-class:: classref-method
  134. :ref:`int<class_int>` **_get_customization_configuration_hash** **(** **)** |virtual| |const|
  135. Return a hash based on the configuration passed (for both scenes and resources). This helps keep separate caches for separate export configurations.
  136. Implementing this method is required if :ref:`_begin_customize_resources<class_EditorExportPlugin_method__begin_customize_resources>` returns ``true``.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_EditorExportPlugin_method__get_export_features:
  140. .. rst-class:: classref-method
  141. :ref:`PackedStringArray<class_PackedStringArray>` **_get_export_features** **(** :ref:`EditorExportPlatform<class_EditorExportPlatform>` platform, :ref:`bool<class_bool>` debug **)** |virtual| |const|
  142. Return a :ref:`PackedStringArray<class_PackedStringArray>` of additional features this preset, for the given ``platform``, should have.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_EditorExportPlugin_method__get_name:
  146. .. rst-class:: classref-method
  147. :ref:`String<class_String>` **_get_name** **(** **)** |virtual| |const|
  148. Return the name identifier of this plugin (for future identification by the exporter). The plugins are sorted by name before exporting.
  149. Implementing this method is required.
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_EditorExportPlugin_method_add_file:
  153. .. rst-class:: classref-method
  154. void **add_file** **(** :ref:`String<class_String>` path, :ref:`PackedByteArray<class_PackedByteArray>` file, :ref:`bool<class_bool>` remap **)**
  155. 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. If ``remap`` is ``true``, file will not be exported, but instead remapped to the given ``path``.
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_EditorExportPlugin_method_add_ios_bundle_file:
  159. .. rst-class:: classref-method
  160. void **add_ios_bundle_file** **(** :ref:`String<class_String>` path **)**
  161. Adds an iOS bundle file from the given ``path`` to the exported project.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. _class_EditorExportPlugin_method_add_ios_cpp_code:
  165. .. rst-class:: classref-method
  166. void **add_ios_cpp_code** **(** :ref:`String<class_String>` code **)**
  167. Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin.
  168. .. rst-class:: classref-item-separator
  169. ----
  170. .. _class_EditorExportPlugin_method_add_ios_embedded_framework:
  171. .. rst-class:: classref-method
  172. void **add_ios_embedded_framework** **(** :ref:`String<class_String>` path **)**
  173. Adds a dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary.
  174. \ **Note:** For static libraries (\*.a) works in same way as ``add_ios_framework``.
  175. This method should not be used for System libraries as they are already present on the device.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_EditorExportPlugin_method_add_ios_framework:
  179. .. rst-class:: classref-method
  180. void **add_ios_framework** **(** :ref:`String<class_String>` path **)**
  181. Adds a static library (\*.a) or dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_EditorExportPlugin_method_add_ios_linker_flags:
  185. .. rst-class:: classref-method
  186. void **add_ios_linker_flags** **(** :ref:`String<class_String>` flags **)**
  187. Adds linker flags for the iOS export.
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_EditorExportPlugin_method_add_ios_plist_content:
  191. .. rst-class:: classref-method
  192. void **add_ios_plist_content** **(** :ref:`String<class_String>` plist_content **)**
  193. Adds content for iOS Property List files.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_EditorExportPlugin_method_add_ios_project_static_lib:
  197. .. rst-class:: classref-method
  198. void **add_ios_project_static_lib** **(** :ref:`String<class_String>` path **)**
  199. Adds a static lib from the given ``path`` to the iOS project.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_EditorExportPlugin_method_add_macos_plugin_file:
  203. .. rst-class:: classref-method
  204. void **add_macos_plugin_file** **(** :ref:`String<class_String>` path **)**
  205. Adds file or directory matching ``path`` to ``PlugIns`` directory of macOS app bundle.
  206. \ **Note:** This is useful only for macOS exports.
  207. .. rst-class:: classref-item-separator
  208. ----
  209. .. _class_EditorExportPlugin_method_add_shared_object:
  210. .. rst-class:: classref-method
  211. void **add_shared_object** **(** :ref:`String<class_String>` path, :ref:`PackedStringArray<class_PackedStringArray>` tags, :ref:`String<class_String>` target **)**
  212. Adds a shared object or a directory containing only shared objects with the given ``tags`` and destination ``path``.
  213. \ **Note:** In case of macOS exports, those shared objects will be added to ``Frameworks`` directory of app bundle.
  214. In case of a directory code-sign will error if you place non code object in directory.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_EditorExportPlugin_method_skip:
  218. .. rst-class:: classref-method
  219. void **skip** **(** **)**
  220. To be called inside :ref:`_export_file<class_EditorExportPlugin_method__export_file>`. Skips the current file, so it's not included in the export.
  221. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  222. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  223. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  224. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  225. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  226. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`