class_editorplugin.rst 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the EditorPlugin.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_EditorPlugin:
  6. EditorPlugin
  7. ============
  8. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Used by the editor to extend its functionality.
  10. Description
  11. -----------
  12. Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. See also :ref:`EditorScript<class_EditorScript>` to add functions to the editor.
  13. Tutorials
  14. ---------
  15. - :doc:`Editor plugins documentation index <../tutorials/plugins/editor/index>`
  16. Methods
  17. -------
  18. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`_apply_changes<class_EditorPlugin_method__apply_changes>` **(** **)** |virtual| |
  20. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`_build<class_EditorPlugin_method__build>` **(** **)** |virtual| |
  22. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`_clear<class_EditorPlugin_method__clear>` **(** **)** |virtual| |
  24. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`_disable_plugin<class_EditorPlugin_method__disable_plugin>` **(** **)** |virtual| |
  26. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`_edit<class_EditorPlugin_method__edit>` **(** :ref:`Variant<class_Variant>` object **)** |virtual| |
  28. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`_enable_plugin<class_EditorPlugin_method__enable_plugin>` **(** **)** |virtual| |
  30. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`_forward_3d_draw_over_viewport<class_EditorPlugin_method__forward_3d_draw_over_viewport>` **(** :ref:`Control<class_Control>` viewport_control **)** |virtual| |
  32. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`_forward_3d_force_draw_over_viewport<class_EditorPlugin_method__forward_3d_force_draw_over_viewport>` **(** :ref:`Control<class_Control>` viewport_control **)** |virtual| |
  34. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`_forward_3d_gui_input<class_EditorPlugin_method__forward_3d_gui_input>` **(** :ref:`Camera3D<class_Camera3D>` viewport_camera, :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  36. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`_forward_canvas_draw_over_viewport<class_EditorPlugin_method__forward_canvas_draw_over_viewport>` **(** :ref:`Control<class_Control>` viewport_control **)** |virtual| |
  38. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`_forward_canvas_force_draw_over_viewport<class_EditorPlugin_method__forward_canvas_force_draw_over_viewport>` **(** :ref:`Control<class_Control>` viewport_control **)** |virtual| |
  40. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`_forward_canvas_gui_input<class_EditorPlugin_method__forward_canvas_gui_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual| |
  42. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`_get_breakpoints<class_EditorPlugin_method__get_breakpoints>` **(** **)** |virtual| |const| |
  44. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Texture2D<class_Texture2D>` | :ref:`_get_plugin_icon<class_EditorPlugin_method__get_plugin_icon>` **(** **)** |virtual| |const| |
  46. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`String<class_String>` | :ref:`_get_plugin_name<class_EditorPlugin_method__get_plugin_name>` **(** **)** |virtual| |const| |
  48. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`Dictionary<class_Dictionary>` | :ref:`_get_state<class_EditorPlugin_method__get_state>` **(** **)** |virtual| |const| |
  50. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`_get_window_layout<class_EditorPlugin_method__get_window_layout>` **(** :ref:`ConfigFile<class_ConfigFile>` configuration **)** |virtual| |
  52. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`_handles<class_EditorPlugin_method__handles>` **(** :ref:`Variant<class_Variant>` object **)** |virtual| |const| |
  54. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`_has_main_screen<class_EditorPlugin_method__has_main_screen>` **(** **)** |virtual| |const| |
  56. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`_make_visible<class_EditorPlugin_method__make_visible>` **(** :ref:`bool<class_bool>` visible **)** |virtual| |
  58. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`_save_external_data<class_EditorPlugin_method__save_external_data>` **(** **)** |virtual| |
  60. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`_set_state<class_EditorPlugin_method__set_state>` **(** :ref:`Dictionary<class_Dictionary>` state **)** |virtual| |
  62. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`_set_window_layout<class_EditorPlugin_method__set_window_layout>` **(** :ref:`ConfigFile<class_ConfigFile>` configuration **)** |virtual| |
  64. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | void | :ref:`add_autoload_singleton<class_EditorPlugin_method_add_autoload_singleton>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` path **)** |
  66. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Button<class_Button>` | :ref:`add_control_to_bottom_panel<class_EditorPlugin_method_add_control_to_bottom_panel>` **(** :ref:`Control<class_Control>` control, :ref:`String<class_String>` title **)** |
  68. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`add_control_to_container<class_EditorPlugin_method_add_control_to_container>` **(** :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>` container, :ref:`Control<class_Control>` control **)** |
  70. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`add_control_to_dock<class_EditorPlugin_method_add_control_to_dock>` **(** :ref:`DockSlot<enum_EditorPlugin_DockSlot>` slot, :ref:`Control<class_Control>` control **)** |
  72. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`add_custom_type<class_EditorPlugin_method_add_custom_type>` **(** :ref:`String<class_String>` type, :ref:`String<class_String>` base, :ref:`Script<class_Script>` script, :ref:`Texture2D<class_Texture2D>` icon **)** |
  74. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`add_debugger_plugin<class_EditorPlugin_method_add_debugger_plugin>` **(** :ref:`Script<class_Script>` script **)** |
  76. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`add_export_plugin<class_EditorPlugin_method_add_export_plugin>` **(** :ref:`EditorExportPlugin<class_EditorExportPlugin>` plugin **)** |
  78. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`add_import_plugin<class_EditorPlugin_method_add_import_plugin>` **(** :ref:`EditorImportPlugin<class_EditorImportPlugin>` importer **)** |
  80. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`add_inspector_plugin<class_EditorPlugin_method_add_inspector_plugin>` **(** :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` plugin **)** |
  82. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`add_scene_format_importer_plugin<class_EditorPlugin_method_add_scene_format_importer_plugin>` **(** :ref:`EditorSceneFormatImporter<class_EditorSceneFormatImporter>` scene_format_importer **)** |
  84. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`add_scene_post_import_plugin<class_EditorPlugin_method_add_scene_post_import_plugin>` **(** :ref:`EditorScenePostImportPlugin<class_EditorScenePostImportPlugin>` scene_import_plugin **)** |
  86. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`add_spatial_gizmo_plugin<class_EditorPlugin_method_add_spatial_gizmo_plugin>` **(** :ref:`EditorNode3DGizmoPlugin<class_EditorNode3DGizmoPlugin>` plugin **)** |
  88. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`add_tool_menu_item<class_EditorPlugin_method_add_tool_menu_item>` **(** :ref:`String<class_String>` name, :ref:`Callable<class_Callable>` callable **)** |
  90. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`add_tool_submenu_item<class_EditorPlugin_method_add_tool_submenu_item>` **(** :ref:`String<class_String>` name, :ref:`Object<class_Object>` submenu **)** |
  92. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`add_translation_parser_plugin<class_EditorPlugin_method_add_translation_parser_plugin>` **(** :ref:`EditorTranslationParserPlugin<class_EditorTranslationParserPlugin>` parser **)** |
  94. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`add_undo_redo_inspector_hook_callback<class_EditorPlugin_method_add_undo_redo_inspector_hook_callback>` **(** :ref:`Callable<class_Callable>` callable **)** |
  96. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`EditorInterface<class_EditorInterface>` | :ref:`get_editor_interface<class_EditorPlugin_method_get_editor_interface>` **(** **)** |
  98. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`ScriptCreateDialog<class_ScriptCreateDialog>` | :ref:`get_script_create_dialog<class_EditorPlugin_method_get_script_create_dialog>` **(** **)** |
  100. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`UndoRedo<class_UndoRedo>` | :ref:`get_undo_redo<class_EditorPlugin_method_get_undo_redo>` **(** **)** |
  102. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`hide_bottom_panel<class_EditorPlugin_method_hide_bottom_panel>` **(** **)** |
  104. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`make_bottom_panel_item_visible<class_EditorPlugin_method_make_bottom_panel_item_visible>` **(** :ref:`Control<class_Control>` item **)** |
  106. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`queue_save_layout<class_EditorPlugin_method_queue_save_layout>` **(** **)** |
  108. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`remove_autoload_singleton<class_EditorPlugin_method_remove_autoload_singleton>` **(** :ref:`String<class_String>` name **)** |
  110. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`remove_control_from_bottom_panel<class_EditorPlugin_method_remove_control_from_bottom_panel>` **(** :ref:`Control<class_Control>` control **)** |
  112. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`remove_control_from_container<class_EditorPlugin_method_remove_control_from_container>` **(** :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>` container, :ref:`Control<class_Control>` control **)** |
  114. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`remove_control_from_docks<class_EditorPlugin_method_remove_control_from_docks>` **(** :ref:`Control<class_Control>` control **)** |
  116. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`remove_custom_type<class_EditorPlugin_method_remove_custom_type>` **(** :ref:`String<class_String>` type **)** |
  118. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`remove_debugger_plugin<class_EditorPlugin_method_remove_debugger_plugin>` **(** :ref:`Script<class_Script>` script **)** |
  120. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`remove_export_plugin<class_EditorPlugin_method_remove_export_plugin>` **(** :ref:`EditorExportPlugin<class_EditorExportPlugin>` plugin **)** |
  122. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`remove_import_plugin<class_EditorPlugin_method_remove_import_plugin>` **(** :ref:`EditorImportPlugin<class_EditorImportPlugin>` importer **)** |
  124. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`remove_inspector_plugin<class_EditorPlugin_method_remove_inspector_plugin>` **(** :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` plugin **)** |
  126. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`remove_scene_format_importer_plugin<class_EditorPlugin_method_remove_scene_format_importer_plugin>` **(** :ref:`EditorSceneFormatImporter<class_EditorSceneFormatImporter>` scene_format_importer **)** |
  128. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`remove_scene_post_import_plugin<class_EditorPlugin_method_remove_scene_post_import_plugin>` **(** :ref:`EditorScenePostImportPlugin<class_EditorScenePostImportPlugin>` scene_import_plugin **)** |
  130. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`remove_spatial_gizmo_plugin<class_EditorPlugin_method_remove_spatial_gizmo_plugin>` **(** :ref:`EditorNode3DGizmoPlugin<class_EditorNode3DGizmoPlugin>` plugin **)** |
  132. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`remove_tool_menu_item<class_EditorPlugin_method_remove_tool_menu_item>` **(** :ref:`String<class_String>` name **)** |
  134. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`remove_translation_parser_plugin<class_EditorPlugin_method_remove_translation_parser_plugin>` **(** :ref:`EditorTranslationParserPlugin<class_EditorTranslationParserPlugin>` parser **)** |
  136. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`remove_undo_redo_inspector_hook_callback<class_EditorPlugin_method_remove_undo_redo_inspector_hook_callback>` **(** :ref:`Callable<class_Callable>` callable **)** |
  138. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`set_force_draw_over_forwarding_enabled<class_EditorPlugin_method_set_force_draw_over_forwarding_enabled>` **(** **)** |
  140. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`set_input_event_forwarding_always_enabled<class_EditorPlugin_method_set_input_event_forwarding_always_enabled>` **(** **)** |
  142. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`int<class_int>` | :ref:`update_overlays<class_EditorPlugin_method_update_overlays>` **(** **)** |const| |
  144. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. Signals
  146. -------
  147. .. _class_EditorPlugin_signal_main_screen_changed:
  148. - **main_screen_changed** **(** :ref:`String<class_String>` screen_name **)**
  149. Emitted when user changes the workspace (**2D**, **3D**, **Script**, **AssetLib**). Also works with custom screens defined by plugins.
  150. ----
  151. .. _class_EditorPlugin_signal_project_settings_changed:
  152. - **project_settings_changed** **(** **)**
  153. ----
  154. .. _class_EditorPlugin_signal_resource_saved:
  155. - **resource_saved** **(** :ref:`Resource<class_Resource>` resource **)**
  156. ----
  157. .. _class_EditorPlugin_signal_scene_changed:
  158. - **scene_changed** **(** :ref:`Node<class_Node>` scene_root **)**
  159. Emitted when the scene is changed in the editor. The argument will return the root node of the scene that has just become active. If this scene is new and empty, the argument will be ``null``.
  160. ----
  161. .. _class_EditorPlugin_signal_scene_closed:
  162. - **scene_closed** **(** :ref:`String<class_String>` filepath **)**
  163. Emitted when user closes a scene. The argument is file path to a closed scene.
  164. Enumerations
  165. ------------
  166. .. _enum_EditorPlugin_CustomControlContainer:
  167. .. _class_EditorPlugin_constant_CONTAINER_TOOLBAR:
  168. .. _class_EditorPlugin_constant_CONTAINER_SPATIAL_EDITOR_MENU:
  169. .. _class_EditorPlugin_constant_CONTAINER_SPATIAL_EDITOR_SIDE_LEFT:
  170. .. _class_EditorPlugin_constant_CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT:
  171. .. _class_EditorPlugin_constant_CONTAINER_SPATIAL_EDITOR_BOTTOM:
  172. .. _class_EditorPlugin_constant_CONTAINER_CANVAS_EDITOR_MENU:
  173. .. _class_EditorPlugin_constant_CONTAINER_CANVAS_EDITOR_SIDE_LEFT:
  174. .. _class_EditorPlugin_constant_CONTAINER_CANVAS_EDITOR_SIDE_RIGHT:
  175. .. _class_EditorPlugin_constant_CONTAINER_CANVAS_EDITOR_BOTTOM:
  176. .. _class_EditorPlugin_constant_CONTAINER_PROPERTY_EDITOR_BOTTOM:
  177. .. _class_EditorPlugin_constant_CONTAINER_PROJECT_SETTING_TAB_LEFT:
  178. .. _class_EditorPlugin_constant_CONTAINER_PROJECT_SETTING_TAB_RIGHT:
  179. enum **CustomControlContainer**:
  180. - **CONTAINER_TOOLBAR** = **0**
  181. - **CONTAINER_SPATIAL_EDITOR_MENU** = **1**
  182. - **CONTAINER_SPATIAL_EDITOR_SIDE_LEFT** = **2**
  183. - **CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT** = **3**
  184. - **CONTAINER_SPATIAL_EDITOR_BOTTOM** = **4**
  185. - **CONTAINER_CANVAS_EDITOR_MENU** = **5**
  186. - **CONTAINER_CANVAS_EDITOR_SIDE_LEFT** = **6**
  187. - **CONTAINER_CANVAS_EDITOR_SIDE_RIGHT** = **7**
  188. - **CONTAINER_CANVAS_EDITOR_BOTTOM** = **8**
  189. - **CONTAINER_PROPERTY_EDITOR_BOTTOM** = **9**
  190. - **CONTAINER_PROJECT_SETTING_TAB_LEFT** = **10**
  191. - **CONTAINER_PROJECT_SETTING_TAB_RIGHT** = **11**
  192. ----
  193. .. _enum_EditorPlugin_DockSlot:
  194. .. _class_EditorPlugin_constant_DOCK_SLOT_LEFT_UL:
  195. .. _class_EditorPlugin_constant_DOCK_SLOT_LEFT_BL:
  196. .. _class_EditorPlugin_constant_DOCK_SLOT_LEFT_UR:
  197. .. _class_EditorPlugin_constant_DOCK_SLOT_LEFT_BR:
  198. .. _class_EditorPlugin_constant_DOCK_SLOT_RIGHT_UL:
  199. .. _class_EditorPlugin_constant_DOCK_SLOT_RIGHT_BL:
  200. .. _class_EditorPlugin_constant_DOCK_SLOT_RIGHT_UR:
  201. .. _class_EditorPlugin_constant_DOCK_SLOT_RIGHT_BR:
  202. .. _class_EditorPlugin_constant_DOCK_SLOT_MAX:
  203. enum **DockSlot**:
  204. - **DOCK_SLOT_LEFT_UL** = **0**
  205. - **DOCK_SLOT_LEFT_BL** = **1**
  206. - **DOCK_SLOT_LEFT_UR** = **2**
  207. - **DOCK_SLOT_LEFT_BR** = **3**
  208. - **DOCK_SLOT_RIGHT_UL** = **4**
  209. - **DOCK_SLOT_RIGHT_BL** = **5**
  210. - **DOCK_SLOT_RIGHT_UR** = **6**
  211. - **DOCK_SLOT_RIGHT_BR** = **7**
  212. - **DOCK_SLOT_MAX** = **8** --- Represents the size of the :ref:`DockSlot<enum_EditorPlugin_DockSlot>` enum.
  213. Method Descriptions
  214. -------------------
  215. .. _class_EditorPlugin_method__apply_changes:
  216. - void **_apply_changes** **(** **)** |virtual|
  217. This method is called when the editor is about to save the project, switch to another tab, etc. It asks the plugin to apply any pending state changes to ensure consistency.
  218. This is used, for example, in shader editors to let the plugin know that it must apply the shader code being written by the user to the object.
  219. ----
  220. .. _class_EditorPlugin_method__build:
  221. - :ref:`bool<class_bool>` **_build** **(** **)** |virtual|
  222. This method is called when the editor is about to run the project. The plugin can then perform required operations before the project runs.
  223. This method must return a boolean. If this method returns ``false``, the project will not run. The run is aborted immediately, so this also prevents all other plugins' :ref:`_build<class_EditorPlugin_method__build>` methods from running.
  224. ----
  225. .. _class_EditorPlugin_method__clear:
  226. - void **_clear** **(** **)** |virtual|
  227. Clear all the state and reset the object being edited to zero. This ensures your plugin does not keep editing a currently existing node, or a node from the wrong scene.
  228. ----
  229. .. _class_EditorPlugin_method__disable_plugin:
  230. - void **_disable_plugin** **(** **)** |virtual|
  231. Called by the engine when the user disables the ``EditorPlugin`` in the Plugin tab of the project settings window.
  232. ----
  233. .. _class_EditorPlugin_method__edit:
  234. - void **_edit** **(** :ref:`Variant<class_Variant>` object **)** |virtual|
  235. This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object.
  236. ----
  237. .. _class_EditorPlugin_method__enable_plugin:
  238. - void **_enable_plugin** **(** **)** |virtual|
  239. Called by the engine when the user enables the ``EditorPlugin`` in the Plugin tab of the project settings window.
  240. ----
  241. .. _class_EditorPlugin_method__forward_3d_draw_over_viewport:
  242. - void **_forward_3d_draw_over_viewport** **(** :ref:`Control<class_Control>` viewport_control **)** |virtual|
  243. Called by the engine when the 3D editor's viewport is updated. Use the ``overlay`` :ref:`Control<class_Control>` for drawing. You can update the viewport manually by calling :ref:`update_overlays<class_EditorPlugin_method_update_overlays>`.
  244. .. tabs::
  245. .. code-tab:: gdscript
  246. func _forward_3d_draw_over_viewport(overlay):
  247. # Draw a circle at cursor position.
  248. overlay.draw_circle(overlay.get_local_mouse_position(), 64)
  249. func _forward_3d_gui_input(camera, event):
  250. if event is InputEventMouseMotion:
  251. # Redraw viewport when cursor is moved.
  252. update_overlays()
  253. return true
  254. return false
  255. .. code-tab:: csharp
  256. public override void _Forward3dDrawOverViewport(Godot.Control overlay)
  257. {
  258. // Draw a circle at cursor position.
  259. overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White);
  260. }
  261. public override bool _Forward3dGuiInput(Godot.Camera3D camera, InputEvent @event)
  262. {
  263. if (@event is InputEventMouseMotion)
  264. {
  265. // Redraw viewport when cursor is moved.
  266. UpdateOverlays();
  267. return true;
  268. }
  269. return false;
  270. ----
  271. .. _class_EditorPlugin_method__forward_3d_force_draw_over_viewport:
  272. - void **_forward_3d_force_draw_over_viewport** **(** :ref:`Control<class_Control>` viewport_control **)** |virtual|
  273. This method is the same as :ref:`_forward_3d_draw_over_viewport<class_EditorPlugin_method__forward_3d_draw_over_viewport>`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
  274. You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled<class_EditorPlugin_method_set_force_draw_over_forwarding_enabled>`.
  275. ----
  276. .. _class_EditorPlugin_method__forward_3d_gui_input:
  277. - :ref:`int<class_int>` **_forward_3d_gui_input** **(** :ref:`Camera3D<class_Camera3D>` viewport_camera, :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  278. Called when there is a root node in the current edited scene, :ref:`_handles<class_EditorPlugin_method__handles>` is implemented and an :ref:`InputEvent<class_InputEvent>` happens in the 3D viewport. Intercepts the :ref:`InputEvent<class_InputEvent>`, if ``return true`` ``EditorPlugin`` consumes the ``event``, otherwise forwards ``event`` to other Editor classes. Example:
  279. .. tabs::
  280. .. code-tab:: gdscript
  281. # Prevents the InputEvent to reach other Editor classes.
  282. func _forward_3d_gui_input(camera, event):
  283. return EditorPlugin.AFTER_GUI_INPUT_STOP
  284. .. code-tab:: csharp
  285. // Prevents the InputEvent to reach other Editor classes.
  286. public override bool _Forward3dGuiInput(Camera3D camera, InputEvent @event)
  287. {
  288. return EditorPlugin.AFTER_GUI_INPUT_STOP;
  289. }
  290. Must ``return false`` in order to forward the :ref:`InputEvent<class_InputEvent>` to other Editor classes. Example:
  291. .. tabs::
  292. .. code-tab:: gdscript
  293. # Consumes InputEventMouseMotion and forwards other InputEvent types.
  294. func _forward_3d_gui_input(camera, event):
  295. return event is InputEventMouseMotion
  296. .. code-tab:: csharp
  297. // Consumes InputEventMouseMotion and forwards other InputEvent types.
  298. public override bool _Forward3dGuiInput(Camera3D camera, InputEvent @event)
  299. {
  300. return @event is InputEventMouseMotion;
  301. }
  302. ----
  303. .. _class_EditorPlugin_method__forward_canvas_draw_over_viewport:
  304. - void **_forward_canvas_draw_over_viewport** **(** :ref:`Control<class_Control>` viewport_control **)** |virtual|
  305. Called by the engine when the 2D editor's viewport is updated. Use the ``overlay`` :ref:`Control<class_Control>` for drawing. You can update the viewport manually by calling :ref:`update_overlays<class_EditorPlugin_method_update_overlays>`.
  306. .. tabs::
  307. .. code-tab:: gdscript
  308. func _forward_canvas_draw_over_viewport(overlay):
  309. # Draw a circle at cursor position.
  310. overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white)
  311. func _forward_canvas_gui_input(event):
  312. if event is InputEventMouseMotion:
  313. # Redraw viewport when cursor is moved.
  314. update_overlays()
  315. return true
  316. return false
  317. .. code-tab:: csharp
  318. public override void ForwardCanvasDrawOverViewport(Godot.Control overlay)
  319. {
  320. // Draw a circle at cursor position.
  321. overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White);
  322. }
  323. public override bool ForwardCanvasGuiInput(InputEvent @event)
  324. {
  325. if (@event is InputEventMouseMotion)
  326. {
  327. // Redraw viewport when cursor is moved.
  328. UpdateOverlays();
  329. return true;
  330. }
  331. return false;
  332. ----
  333. .. _class_EditorPlugin_method__forward_canvas_force_draw_over_viewport:
  334. - void **_forward_canvas_force_draw_over_viewport** **(** :ref:`Control<class_Control>` viewport_control **)** |virtual|
  335. This method is the same as :ref:`_forward_canvas_draw_over_viewport<class_EditorPlugin_method__forward_canvas_draw_over_viewport>`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else.
  336. You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled<class_EditorPlugin_method_set_force_draw_over_forwarding_enabled>`.
  337. ----
  338. .. _class_EditorPlugin_method__forward_canvas_gui_input:
  339. - :ref:`bool<class_bool>` **_forward_canvas_gui_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** |virtual|
  340. Called when there is a root node in the current edited scene, :ref:`_handles<class_EditorPlugin_method__handles>` is implemented and an :ref:`InputEvent<class_InputEvent>` happens in the 2D viewport. Intercepts the :ref:`InputEvent<class_InputEvent>`, if ``return true`` ``EditorPlugin`` consumes the ``event``, otherwise forwards ``event`` to other Editor classes. Example:
  341. .. tabs::
  342. .. code-tab:: gdscript
  343. # Prevents the InputEvent to reach other Editor classes.
  344. func _forward_canvas_gui_input(event):
  345. return true
  346. .. code-tab:: csharp
  347. // Prevents the InputEvent to reach other Editor classes.
  348. public override bool ForwardCanvasGuiInput(InputEvent @event)
  349. {
  350. return true;
  351. }
  352. Must ``return false`` in order to forward the :ref:`InputEvent<class_InputEvent>` to other Editor classes. Example:
  353. .. tabs::
  354. .. code-tab:: gdscript
  355. # Consumes InputEventMouseMotion and forwards other InputEvent types.
  356. func _forward_canvas_gui_input(event):
  357. if (event is InputEventMouseMotion):
  358. return true
  359. return false
  360. .. code-tab:: csharp
  361. // Consumes InputEventMouseMotion and forwards other InputEvent types.
  362. public override bool ForwardCanvasGuiInput(InputEvent @event)
  363. {
  364. if (@event is InputEventMouseMotion) {
  365. return true;
  366. }
  367. return false
  368. }
  369. ----
  370. .. _class_EditorPlugin_method__get_breakpoints:
  371. - :ref:`PackedStringArray<class_PackedStringArray>` **_get_breakpoints** **(** **)** |virtual| |const|
  372. This is for editors that edit script-based objects. You can return a list of breakpoints in the format (``script:line``), for example: ``res://path_to_script.gd:25``.
  373. ----
  374. .. _class_EditorPlugin_method__get_plugin_icon:
  375. - :ref:`Texture2D<class_Texture2D>` **_get_plugin_icon** **(** **)** |virtual| |const|
  376. Override this method in your plugin to return a :ref:`Texture2D<class_Texture2D>` in order to give it an icon.
  377. For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
  378. Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size.
  379. .. tabs::
  380. .. code-tab:: gdscript
  381. func _get_plugin_icon():
  382. # You can use a custom icon:
  383. return preload("res://addons/my_plugin/my_plugin_icon.svg")
  384. # Or use a built-in icon:
  385. return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons")
  386. .. code-tab:: csharp
  387. public override Texture2D GetPluginIcon()
  388. {
  389. // You can use a custom icon:
  390. return ResourceLoader.Load<Texture2D>("res://addons/my_plugin/my_plugin_icon.svg");
  391. // Or use a built-in icon:
  392. return GetEditorInterface().GetBaseControl().GetIcon("Node", "EditorIcons");
  393. }
  394. ----
  395. .. _class_EditorPlugin_method__get_plugin_name:
  396. - :ref:`String<class_String>` **_get_plugin_name** **(** **)** |virtual| |const|
  397. Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor.
  398. For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
  399. ----
  400. .. _class_EditorPlugin_method__get_state:
  401. - :ref:`Dictionary<class_Dictionary>` **_get_state** **(** **)** |virtual| |const|
  402. Gets the state of your plugin editor. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns).
  403. ----
  404. .. _class_EditorPlugin_method__get_window_layout:
  405. - void **_get_window_layout** **(** :ref:`ConfigFile<class_ConfigFile>` configuration **)** |virtual|
  406. Gets the GUI layout of the plugin. This is used to save the project's editor layout when :ref:`queue_save_layout<class_EditorPlugin_method_queue_save_layout>` is called or the editor layout was changed(For example changing the position of a dock).
  407. ----
  408. .. _class_EditorPlugin_method__handles:
  409. - :ref:`bool<class_bool>` **_handles** **(** :ref:`Variant<class_Variant>` object **)** |virtual| |const|
  410. Implement this function if your plugin edits a specific type of object (Resource or Node). If you return ``true``, then you will get the functions :ref:`_edit<class_EditorPlugin_method__edit>` and :ref:`_make_visible<class_EditorPlugin_method__make_visible>` called when the editor requests them. If you have declared the methods :ref:`_forward_canvas_gui_input<class_EditorPlugin_method__forward_canvas_gui_input>` and :ref:`_forward_3d_gui_input<class_EditorPlugin_method__forward_3d_gui_input>` these will be called too.
  411. ----
  412. .. _class_EditorPlugin_method__has_main_screen:
  413. - :ref:`bool<class_bool>` **_has_main_screen** **(** **)** |virtual| |const|
  414. Returns ``true`` if this is a main screen editor plugin (it goes in the workspace selector together with **2D**, **3D**, **Script** and **AssetLib**).
  415. ----
  416. .. _class_EditorPlugin_method__make_visible:
  417. - void **_make_visible** **(** :ref:`bool<class_bool>` visible **)** |virtual|
  418. This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type.
  419. Remember that you have to manage the visibility of all your editor controls manually.
  420. ----
  421. .. _class_EditorPlugin_method__save_external_data:
  422. - void **_save_external_data** **(** **)** |virtual|
  423. This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources.
  424. ----
  425. .. _class_EditorPlugin_method__set_state:
  426. - void **_set_state** **(** :ref:`Dictionary<class_Dictionary>` state **)** |virtual|
  427. Restore the state saved by :ref:`_get_state<class_EditorPlugin_method__get_state>`.
  428. ----
  429. .. _class_EditorPlugin_method__set_window_layout:
  430. - void **_set_window_layout** **(** :ref:`ConfigFile<class_ConfigFile>` configuration **)** |virtual|
  431. Restore the plugin GUI layout saved by :ref:`_get_window_layout<class_EditorPlugin_method__get_window_layout>`.
  432. ----
  433. .. _class_EditorPlugin_method_add_autoload_singleton:
  434. - void **add_autoload_singleton** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` path **)**
  435. Adds a script at ``path`` to the Autoload list as ``name``.
  436. ----
  437. .. _class_EditorPlugin_method_add_control_to_bottom_panel:
  438. - :ref:`Button<class_Button>` **add_control_to_bottom_panel** **(** :ref:`Control<class_Control>` control, :ref:`String<class_String>` title **)**
  439. Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_bottom_panel<class_EditorPlugin_method_remove_control_from_bottom_panel>` and free it with :ref:`Node.queue_free<class_Node_method_queue_free>`.
  440. ----
  441. .. _class_EditorPlugin_method_add_control_to_container:
  442. - void **add_control_to_container** **(** :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>` container, :ref:`Control<class_Control>` control **)**
  443. Adds a custom control to a container (see :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>`). There are many locations where custom controls can be added in the editor UI.
  444. Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it).
  445. When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_container<class_EditorPlugin_method_remove_control_from_container>` and free it with :ref:`Node.queue_free<class_Node_method_queue_free>`.
  446. ----
  447. .. _class_EditorPlugin_method_add_control_to_dock:
  448. - void **add_control_to_dock** **(** :ref:`DockSlot<enum_EditorPlugin_DockSlot>` slot, :ref:`Control<class_Control>` control **)**
  449. Adds the control to a specific dock slot (see :ref:`DockSlot<enum_EditorPlugin_DockSlot>` for options).
  450. If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions.
  451. When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_docks<class_EditorPlugin_method_remove_control_from_docks>` and free it with :ref:`Node.queue_free<class_Node_method_queue_free>`.
  452. ----
  453. .. _class_EditorPlugin_method_add_custom_type:
  454. - void **add_custom_type** **(** :ref:`String<class_String>` type, :ref:`String<class_String>` base, :ref:`Script<class_Script>` script, :ref:`Texture2D<class_Texture2D>` icon **)**
  455. Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.
  456. When a given node or resource is selected, the base type will be instantiated (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object.
  457. You can use the virtual method :ref:`_handles<class_EditorPlugin_method__handles>` to check if your custom object is being edited by checking the script or using the ``is`` keyword.
  458. During run-time, this will be a simple object with a script so this function does not need to be called then.
  459. ----
  460. .. _class_EditorPlugin_method_add_debugger_plugin:
  461. - void **add_debugger_plugin** **(** :ref:`Script<class_Script>` script **)**
  462. Adds a :ref:`Script<class_Script>` as debugger plugin to the Debugger. The script must extend :ref:`EditorDebuggerPlugin<class_EditorDebuggerPlugin>`.
  463. ----
  464. .. _class_EditorPlugin_method_add_export_plugin:
  465. - void **add_export_plugin** **(** :ref:`EditorExportPlugin<class_EditorExportPlugin>` plugin **)**
  466. Registers a new :ref:`EditorExportPlugin<class_EditorExportPlugin>`. Export plugins are used to perform tasks when the project is being exported.
  467. See :ref:`add_inspector_plugin<class_EditorPlugin_method_add_inspector_plugin>` for an example of how to register a plugin.
  468. ----
  469. .. _class_EditorPlugin_method_add_import_plugin:
  470. - void **add_import_plugin** **(** :ref:`EditorImportPlugin<class_EditorImportPlugin>` importer **)**
  471. Registers a new :ref:`EditorImportPlugin<class_EditorImportPlugin>`. Import plugins are used to import custom and unsupported assets as a custom :ref:`Resource<class_Resource>` type.
  472. **Note:** If you want to import custom 3D asset formats use :ref:`add_scene_format_importer_plugin<class_EditorPlugin_method_add_scene_format_importer_plugin>` instead.
  473. See :ref:`add_inspector_plugin<class_EditorPlugin_method_add_inspector_plugin>` for an example of how to register a plugin.
  474. ----
  475. .. _class_EditorPlugin_method_add_inspector_plugin:
  476. - void **add_inspector_plugin** **(** :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` plugin **)**
  477. Registers a new :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>`. Inspector plugins are used to extend :ref:`EditorInspector<class_EditorInspector>` and provide custom configuration tools for your object's properties.
  478. **Note:** Always use :ref:`remove_inspector_plugin<class_EditorPlugin_method_remove_inspector_plugin>` to remove the registered :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` when your ``EditorPlugin`` is disabled to prevent leaks and an unexpected behavior.
  479. .. tabs::
  480. .. code-tab:: gdscript
  481. const MyInspectorPlugin = preload("res://addons/your_addon/path/to/your/script.gd")
  482. var inspector_plugin = MyInspectorPlugin.new()
  483. func _enter_tree():
  484. add_inspector_plugin(inspector_plugin)
  485. func _exit_tree():
  486. remove_inspector_plugin(inspector_plugin)
  487. ----
  488. .. _class_EditorPlugin_method_add_scene_format_importer_plugin:
  489. - void **add_scene_format_importer_plugin** **(** :ref:`EditorSceneFormatImporter<class_EditorSceneFormatImporter>` scene_format_importer **)**
  490. Registers a new :ref:`EditorSceneFormatImporter<class_EditorSceneFormatImporter>`. Scene importers are used to import custom 3D asset formats as scenes.
  491. ----
  492. .. _class_EditorPlugin_method_add_scene_post_import_plugin:
  493. - void **add_scene_post_import_plugin** **(** :ref:`EditorScenePostImportPlugin<class_EditorScenePostImportPlugin>` scene_import_plugin **)**
  494. Add a :ref:`EditorScenePostImportPlugin<class_EditorScenePostImportPlugin>`. These plugins allow customizing the import process of 3D assets by adding new options to the import dialogs.
  495. ----
  496. .. _class_EditorPlugin_method_add_spatial_gizmo_plugin:
  497. - void **add_spatial_gizmo_plugin** **(** :ref:`EditorNode3DGizmoPlugin<class_EditorNode3DGizmoPlugin>` plugin **)**
  498. Registers a new :ref:`EditorNode3DGizmoPlugin<class_EditorNode3DGizmoPlugin>`. Gizmo plugins are used to add custom gizmos to the 3D preview viewport for a :ref:`Node3D<class_Node3D>`.
  499. See :ref:`add_inspector_plugin<class_EditorPlugin_method_add_inspector_plugin>` for an example of how to register a plugin.
  500. ----
  501. .. _class_EditorPlugin_method_add_tool_menu_item:
  502. - void **add_tool_menu_item** **(** :ref:`String<class_String>` name, :ref:`Callable<class_Callable>` callable **)**
  503. Adds a custom menu item to **Project > Tools** named ``name``. When clicked, the provided ``callable`` will be called.
  504. ----
  505. .. _class_EditorPlugin_method_add_tool_submenu_item:
  506. - void **add_tool_submenu_item** **(** :ref:`String<class_String>` name, :ref:`Object<class_Object>` submenu **)**
  507. Adds a custom submenu under **Project > Tools >** ``name``. ``submenu`` should be an object of class :ref:`PopupMenu<class_PopupMenu>`. Use ``remove_tool_menu_item(name)`` on plugin clean up to remove the menu.
  508. ----
  509. .. _class_EditorPlugin_method_add_translation_parser_plugin:
  510. - void **add_translation_parser_plugin** **(** :ref:`EditorTranslationParserPlugin<class_EditorTranslationParserPlugin>` parser **)**
  511. Registers a custom translation parser plugin for extracting translatable strings from custom files.
  512. ----
  513. .. _class_EditorPlugin_method_add_undo_redo_inspector_hook_callback:
  514. - void **add_undo_redo_inspector_hook_callback** **(** :ref:`Callable<class_Callable>` callable **)**
  515. Hooks a callback into the undo/redo action creation when a property is modified in the inspector. This allows, for example, to save other properties that may be lost when a given property is modified.
  516. The callback should have 4 arguments: :ref:`Object<class_Object>` ``undo_redo``, :ref:`Object<class_Object>` ``modified_object``, :ref:`String<class_String>` ``property`` and :ref:`Variant<class_Variant>` ``new_value``. They are, respectively, the :ref:`UndoRedo<class_UndoRedo>` object used by the inspector, the currently modified object, the name of the modified property and the new value the property is about to take.
  517. ----
  518. .. _class_EditorPlugin_method_get_editor_interface:
  519. - :ref:`EditorInterface<class_EditorInterface>` **get_editor_interface** **(** **)**
  520. Returns the :ref:`EditorInterface<class_EditorInterface>` object that gives you control over Godot editor's window and its functionalities.
  521. ----
  522. .. _class_EditorPlugin_method_get_script_create_dialog:
  523. - :ref:`ScriptCreateDialog<class_ScriptCreateDialog>` **get_script_create_dialog** **(** **)**
  524. Gets the Editor's dialogue used for making scripts.
  525. **Note:** Users can configure it before use.
  526. **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  527. ----
  528. .. _class_EditorPlugin_method_get_undo_redo:
  529. - :ref:`UndoRedo<class_UndoRedo>` **get_undo_redo** **(** **)**
  530. Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it.
  531. ----
  532. .. _class_EditorPlugin_method_hide_bottom_panel:
  533. - void **hide_bottom_panel** **(** **)**
  534. Minimizes the bottom panel.
  535. ----
  536. .. _class_EditorPlugin_method_make_bottom_panel_item_visible:
  537. - void **make_bottom_panel_item_visible** **(** :ref:`Control<class_Control>` item **)**
  538. Makes a specific item in the bottom panel visible.
  539. ----
  540. .. _class_EditorPlugin_method_queue_save_layout:
  541. - void **queue_save_layout** **(** **)**
  542. Queue save the project's editor layout.
  543. ----
  544. .. _class_EditorPlugin_method_remove_autoload_singleton:
  545. - void **remove_autoload_singleton** **(** :ref:`String<class_String>` name **)**
  546. Removes an Autoload ``name`` from the list.
  547. ----
  548. .. _class_EditorPlugin_method_remove_control_from_bottom_panel:
  549. - void **remove_control_from_bottom_panel** **(** :ref:`Control<class_Control>` control **)**
  550. Removes the control from the bottom panel. You have to manually :ref:`Node.queue_free<class_Node_method_queue_free>` the control.
  551. ----
  552. .. _class_EditorPlugin_method_remove_control_from_container:
  553. - void **remove_control_from_container** **(** :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>` container, :ref:`Control<class_Control>` control **)**
  554. Removes the control from the specified container. You have to manually :ref:`Node.queue_free<class_Node_method_queue_free>` the control.
  555. ----
  556. .. _class_EditorPlugin_method_remove_control_from_docks:
  557. - void **remove_control_from_docks** **(** :ref:`Control<class_Control>` control **)**
  558. Removes the control from the dock. You have to manually :ref:`Node.queue_free<class_Node_method_queue_free>` the control.
  559. ----
  560. .. _class_EditorPlugin_method_remove_custom_type:
  561. - void **remove_custom_type** **(** :ref:`String<class_String>` type **)**
  562. Removes a custom type added by :ref:`add_custom_type<class_EditorPlugin_method_add_custom_type>`.
  563. ----
  564. .. _class_EditorPlugin_method_remove_debugger_plugin:
  565. - void **remove_debugger_plugin** **(** :ref:`Script<class_Script>` script **)**
  566. Removes the debugger plugin with given script from the Debugger.
  567. ----
  568. .. _class_EditorPlugin_method_remove_export_plugin:
  569. - void **remove_export_plugin** **(** :ref:`EditorExportPlugin<class_EditorExportPlugin>` plugin **)**
  570. Removes an export plugin registered by :ref:`add_export_plugin<class_EditorPlugin_method_add_export_plugin>`.
  571. ----
  572. .. _class_EditorPlugin_method_remove_import_plugin:
  573. - void **remove_import_plugin** **(** :ref:`EditorImportPlugin<class_EditorImportPlugin>` importer **)**
  574. Removes an import plugin registered by :ref:`add_import_plugin<class_EditorPlugin_method_add_import_plugin>`.
  575. ----
  576. .. _class_EditorPlugin_method_remove_inspector_plugin:
  577. - void **remove_inspector_plugin** **(** :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` plugin **)**
  578. Removes an inspector plugin registered by :ref:`add_import_plugin<class_EditorPlugin_method_add_import_plugin>`
  579. ----
  580. .. _class_EditorPlugin_method_remove_scene_format_importer_plugin:
  581. - void **remove_scene_format_importer_plugin** **(** :ref:`EditorSceneFormatImporter<class_EditorSceneFormatImporter>` scene_format_importer **)**
  582. Removes a scene format importer registered by :ref:`add_scene_format_importer_plugin<class_EditorPlugin_method_add_scene_format_importer_plugin>`.
  583. ----
  584. .. _class_EditorPlugin_method_remove_scene_post_import_plugin:
  585. - void **remove_scene_post_import_plugin** **(** :ref:`EditorScenePostImportPlugin<class_EditorScenePostImportPlugin>` scene_import_plugin **)**
  586. Remove the :ref:`EditorScenePostImportPlugin<class_EditorScenePostImportPlugin>`, added with :ref:`add_scene_post_import_plugin<class_EditorPlugin_method_add_scene_post_import_plugin>`.
  587. ----
  588. .. _class_EditorPlugin_method_remove_spatial_gizmo_plugin:
  589. - void **remove_spatial_gizmo_plugin** **(** :ref:`EditorNode3DGizmoPlugin<class_EditorNode3DGizmoPlugin>` plugin **)**
  590. Removes a gizmo plugin registered by :ref:`add_spatial_gizmo_plugin<class_EditorPlugin_method_add_spatial_gizmo_plugin>`.
  591. ----
  592. .. _class_EditorPlugin_method_remove_tool_menu_item:
  593. - void **remove_tool_menu_item** **(** :ref:`String<class_String>` name **)**
  594. Removes a menu ``name`` from **Project > Tools**.
  595. ----
  596. .. _class_EditorPlugin_method_remove_translation_parser_plugin:
  597. - void **remove_translation_parser_plugin** **(** :ref:`EditorTranslationParserPlugin<class_EditorTranslationParserPlugin>` parser **)**
  598. Removes a custom translation parser plugin registered by :ref:`add_translation_parser_plugin<class_EditorPlugin_method_add_translation_parser_plugin>`.
  599. ----
  600. .. _class_EditorPlugin_method_remove_undo_redo_inspector_hook_callback:
  601. - void **remove_undo_redo_inspector_hook_callback** **(** :ref:`Callable<class_Callable>` callable **)**
  602. Removes a callback previsously added by :ref:`add_undo_redo_inspector_hook_callback<class_EditorPlugin_method_add_undo_redo_inspector_hook_callback>`.
  603. ----
  604. .. _class_EditorPlugin_method_set_force_draw_over_forwarding_enabled:
  605. - void **set_force_draw_over_forwarding_enabled** **(** **)**
  606. Enables calling of :ref:`_forward_canvas_force_draw_over_viewport<class_EditorPlugin_method__forward_canvas_force_draw_over_viewport>` for the 2D editor and :ref:`_forward_3d_force_draw_over_viewport<class_EditorPlugin_method__forward_3d_force_draw_over_viewport>` for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin.
  607. ----
  608. .. _class_EditorPlugin_method_set_input_event_forwarding_always_enabled:
  609. - void **set_input_event_forwarding_always_enabled** **(** **)**
  610. Use this method if you always want to receive inputs from 3D view screen inside :ref:`_forward_3d_gui_input<class_EditorPlugin_method__forward_3d_gui_input>`. It might be especially usable if your plugin will want to use raycast in the scene.
  611. ----
  612. .. _class_EditorPlugin_method_update_overlays:
  613. - :ref:`int<class_int>` **update_overlays** **(** **)** |const|
  614. Updates the overlays of the 2D and 3D editor viewport. Causes methods :ref:`_forward_canvas_draw_over_viewport<class_EditorPlugin_method__forward_canvas_draw_over_viewport>`, :ref:`_forward_canvas_force_draw_over_viewport<class_EditorPlugin_method__forward_canvas_force_draw_over_viewport>`, :ref:`_forward_3d_draw_over_viewport<class_EditorPlugin_method__forward_3d_draw_over_viewport>` and :ref:`_forward_3d_force_draw_over_viewport<class_EditorPlugin_method__forward_3d_force_draw_over_viewport>` to be called.
  615. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  616. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  617. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  618. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  619. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  620. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`