class_editorexportplugin.rst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_EditorExportPlugin_method__begin_customize_scenes:
  80. .. rst-class:: classref-method
  81. :ref:`bool<class_bool>` **_begin_customize_scenes** **(** :ref:`EditorExportPlatform<class_EditorExportPlatform>` platform, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual| |const|
  82. Return true if this plugin will customize scenes based on the platform and features used.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_EditorExportPlugin_method__customize_resource:
  86. .. rst-class:: classref-method
  87. :ref:`Resource<class_Resource>` **_customize_resource** **(** :ref:`Resource<class_Resource>` resource, :ref:`String<class_String>` path **)** |virtual|
  88. Customize a resource. If changes are made to it, return the same or a new resource. Otherwise, return ``null``.
  89. 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.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_EditorExportPlugin_method__customize_scene:
  93. .. rst-class:: classref-method
  94. :ref:`Node<class_Node>` **_customize_scene** **(** :ref:`Node<class_Node>` scene, :ref:`String<class_String>` path **)** |virtual|
  95. 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.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_EditorExportPlugin_method__end_customize_resources:
  99. .. rst-class:: classref-method
  100. void **_end_customize_resources** **(** **)** |virtual|
  101. This is called when the customization process for resources ends.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_EditorExportPlugin_method__end_customize_scenes:
  105. .. rst-class:: classref-method
  106. void **_end_customize_scenes** **(** **)** |virtual|
  107. This is called when the customization process for scenes ends.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_EditorExportPlugin_method__export_begin:
  111. .. rst-class:: classref-method
  112. 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|
  113. 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.
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_EditorExportPlugin_method__export_end:
  117. .. rst-class:: classref-method
  118. void **_export_end** **(** **)** |virtual|
  119. Virtual method to be overridden by the user. Called when the export is finished.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_EditorExportPlugin_method__export_file:
  123. .. rst-class:: classref-method
  124. void **_export_file** **(** :ref:`String<class_String>` path, :ref:`String<class_String>` type, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual|
  125. 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.
  126. Calling :ref:`skip<class_EditorExportPlugin_method_skip>` inside this callback will make the file not included in the export.
  127. .. rst-class:: classref-item-separator
  128. ----
  129. .. _class_EditorExportPlugin_method__get_customization_configuration_hash:
  130. .. rst-class:: classref-method
  131. :ref:`int<class_int>` **_get_customization_configuration_hash** **(** **)** |virtual| |const|
  132. Return a hash based on the configuration passed (for both scenes and resources). This helps keep separate caches for separate export configurations.
  133. .. rst-class:: classref-item-separator
  134. ----
  135. .. _class_EditorExportPlugin_method__get_export_features:
  136. .. rst-class:: classref-method
  137. :ref:`PackedStringArray<class_PackedStringArray>` **_get_export_features** **(** :ref:`EditorExportPlatform<class_EditorExportPlatform>` platform, :ref:`bool<class_bool>` debug **)** |virtual| |const|
  138. Return a :ref:`PackedStringArray<class_PackedStringArray>` of additional features this preset, for the given ``platform``, should have.
  139. .. rst-class:: classref-item-separator
  140. ----
  141. .. _class_EditorExportPlugin_method__get_name:
  142. .. rst-class:: classref-method
  143. :ref:`String<class_String>` **_get_name** **(** **)** |virtual| |const|
  144. Return the name identifier of this plugin (for future identification by the exporter).
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_EditorExportPlugin_method_add_file:
  148. .. rst-class:: classref-method
  149. void **add_file** **(** :ref:`String<class_String>` path, :ref:`PackedByteArray<class_PackedByteArray>` file, :ref:`bool<class_bool>` remap **)**
  150. 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``.
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_EditorExportPlugin_method_add_ios_bundle_file:
  154. .. rst-class:: classref-method
  155. void **add_ios_bundle_file** **(** :ref:`String<class_String>` path **)**
  156. Adds an iOS bundle file from the given ``path`` to the exported project.
  157. .. rst-class:: classref-item-separator
  158. ----
  159. .. _class_EditorExportPlugin_method_add_ios_cpp_code:
  160. .. rst-class:: classref-method
  161. void **add_ios_cpp_code** **(** :ref:`String<class_String>` code **)**
  162. Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_EditorExportPlugin_method_add_ios_embedded_framework:
  166. .. rst-class:: classref-method
  167. void **add_ios_embedded_framework** **(** :ref:`String<class_String>` path **)**
  168. Adds a dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary.
  169. \ **Note:** For static libraries (\*.a) works in same way as ``add_ios_framework``.
  170. This method should not be used for System libraries as they are already present on the device.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_EditorExportPlugin_method_add_ios_framework:
  174. .. rst-class:: classref-method
  175. void **add_ios_framework** **(** :ref:`String<class_String>` path **)**
  176. Adds a static library (\*.a) or dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_EditorExportPlugin_method_add_ios_linker_flags:
  180. .. rst-class:: classref-method
  181. void **add_ios_linker_flags** **(** :ref:`String<class_String>` flags **)**
  182. Adds linker flags for the iOS export.
  183. .. rst-class:: classref-item-separator
  184. ----
  185. .. _class_EditorExportPlugin_method_add_ios_plist_content:
  186. .. rst-class:: classref-method
  187. void **add_ios_plist_content** **(** :ref:`String<class_String>` plist_content **)**
  188. Adds content for iOS Property List files.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_EditorExportPlugin_method_add_ios_project_static_lib:
  192. .. rst-class:: classref-method
  193. void **add_ios_project_static_lib** **(** :ref:`String<class_String>` path **)**
  194. Adds a static lib from the given ``path`` to the iOS project.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_EditorExportPlugin_method_add_macos_plugin_file:
  198. .. rst-class:: classref-method
  199. void **add_macos_plugin_file** **(** :ref:`String<class_String>` path **)**
  200. Adds file or directory matching ``path`` to ``PlugIns`` directory of macOS app bundle.
  201. \ **Note:** This is useful only for macOS exports.
  202. .. rst-class:: classref-item-separator
  203. ----
  204. .. _class_EditorExportPlugin_method_add_shared_object:
  205. .. rst-class:: classref-method
  206. void **add_shared_object** **(** :ref:`String<class_String>` path, :ref:`PackedStringArray<class_PackedStringArray>` tags, :ref:`String<class_String>` target **)**
  207. Adds a shared object or a directory containing only shared objects with the given ``tags`` and destination ``path``.
  208. \ **Note:** In case of macOS exports, those shared objects will be added to ``Frameworks`` directory of app bundle.
  209. In case of a directory code-sign will error if you place non code object in directory.
  210. .. rst-class:: classref-item-separator
  211. ----
  212. .. _class_EditorExportPlugin_method_skip:
  213. .. rst-class:: classref-method
  214. void **skip** **(** **)**
  215. To be called inside :ref:`_export_file<class_EditorExportPlugin_method__export_file>`. Skips the current file, so it's not included in the export.
  216. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  217. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  218. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  219. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  220. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  221. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`