class_editorplugin.rst 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the EditorPlugin.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_EditorPlugin:
  5. EditorPlugin
  6. ============
  7. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Used by the editor to extend its functionality.
  12. Methods
  13. -------
  14. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_autoload_singleton<class_EditorPlugin_add_autoload_singleton>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` path **)** |
  16. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`ToolButton<class_ToolButton>` | :ref:`add_control_to_bottom_panel<class_EditorPlugin_add_control_to_bottom_panel>` **(** :ref:`Control<class_Control>` control, :ref:`String<class_String>` title **)** |
  18. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`add_control_to_container<class_EditorPlugin_add_control_to_container>` **(** :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>` container, :ref:`Control<class_Control>` control **)** |
  20. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`add_control_to_dock<class_EditorPlugin_add_control_to_dock>` **(** :ref:`DockSlot<enum_EditorPlugin_DockSlot>` slot, :ref:`Control<class_Control>` control **)** |
  22. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`add_custom_type<class_EditorPlugin_add_custom_type>` **(** :ref:`String<class_String>` type, :ref:`String<class_String>` base, :ref:`Script<class_Script>` script, :ref:`Texture<class_Texture>` icon **)** |
  24. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`add_export_plugin<class_EditorPlugin_add_export_plugin>` **(** :ref:`EditorExportPlugin<class_EditorExportPlugin>` plugin **)** |
  26. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`add_import_plugin<class_EditorPlugin_add_import_plugin>` **(** :ref:`EditorImportPlugin<class_EditorImportPlugin>` importer **)** |
  28. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`add_inspector_plugin<class_EditorPlugin_add_inspector_plugin>` **(** :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` plugin **)** |
  30. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`add_scene_import_plugin<class_EditorPlugin_add_scene_import_plugin>` **(** :ref:`EditorSceneImporter<class_EditorSceneImporter>` scene_importer **)** |
  32. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`add_tool_menu_item<class_EditorPlugin_add_tool_menu_item>` **(** :ref:`String<class_String>` name, :ref:`Object<class_Object>` handler, :ref:`String<class_String>` callback, :ref:`Variant<class_Variant>` ud=null **)** |
  34. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`add_tool_submenu_item<class_EditorPlugin_add_tool_submenu_item>` **(** :ref:`String<class_String>` name, :ref:`Object<class_Object>` submenu **)** |
  36. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`apply_changes<class_EditorPlugin_apply_changes>` **(** **)** virtual |
  38. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`build<class_EditorPlugin_build>` **(** **)** virtual |
  40. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`clear<class_EditorPlugin_clear>` **(** **)** virtual |
  42. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`disable_plugin<class_EditorPlugin_disable_plugin>` **(** **)** virtual |
  44. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`edit<class_EditorPlugin_edit>` **(** :ref:`Object<class_Object>` object **)** virtual |
  46. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`enable_plugin<class_EditorPlugin_enable_plugin>` **(** **)** virtual |
  48. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`forward_canvas_draw_over_viewport<class_EditorPlugin_forward_canvas_draw_over_viewport>` **(** :ref:`Control<class_Control>` overlay **)** virtual |
  50. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`forward_canvas_force_draw_over_viewport<class_EditorPlugin_forward_canvas_force_draw_over_viewport>` **(** :ref:`Control<class_Control>` overlay **)** virtual |
  52. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`forward_canvas_gui_input<class_EditorPlugin_forward_canvas_gui_input>` **(** :ref:`InputEvent<class_InputEvent>` event **)** virtual |
  54. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`forward_spatial_gui_input<class_EditorPlugin_forward_spatial_gui_input>` **(** :ref:`Camera<class_Camera>` camera, :ref:`InputEvent<class_InputEvent>` event **)** virtual |
  56. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_breakpoints<class_EditorPlugin_get_breakpoints>` **(** **)** virtual |
  58. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`EditorInterface<class_EditorInterface>` | :ref:`get_editor_interface<class_EditorPlugin_get_editor_interface>` **(** **)** |
  60. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`Object<class_Object>` | :ref:`get_plugin_icon<class_EditorPlugin_get_plugin_icon>` **(** **)** virtual |
  62. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`String<class_String>` | :ref:`get_plugin_name<class_EditorPlugin_get_plugin_name>` **(** **)** virtual |
  64. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`ScriptCreateDialog<class_ScriptCreateDialog>` | :ref:`get_script_create_dialog<class_EditorPlugin_get_script_create_dialog>` **(** **)** |
  66. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_state<class_EditorPlugin_get_state>` **(** **)** virtual |
  68. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`UndoRedo<class_UndoRedo>` | :ref:`get_undo_redo<class_EditorPlugin_get_undo_redo>` **(** **)** |
  70. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`get_window_layout<class_EditorPlugin_get_window_layout>` **(** :ref:`ConfigFile<class_ConfigFile>` layout **)** virtual |
  72. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`handles<class_EditorPlugin_handles>` **(** :ref:`Object<class_Object>` object **)** virtual |
  74. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`has_main_screen<class_EditorPlugin_has_main_screen>` **(** **)** virtual |
  76. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`hide_bottom_panel<class_EditorPlugin_hide_bottom_panel>` **(** **)** |
  78. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`make_bottom_panel_item_visible<class_EditorPlugin_make_bottom_panel_item_visible>` **(** :ref:`Control<class_Control>` item **)** |
  80. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`make_visible<class_EditorPlugin_make_visible>` **(** :ref:`bool<class_bool>` visible **)** virtual |
  82. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`queue_save_layout<class_EditorPlugin_queue_save_layout>` **(** **)** const |
  84. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`remove_autoload_singleton<class_EditorPlugin_remove_autoload_singleton>` **(** :ref:`String<class_String>` name **)** |
  86. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`remove_control_from_bottom_panel<class_EditorPlugin_remove_control_from_bottom_panel>` **(** :ref:`Control<class_Control>` control **)** |
  88. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`remove_control_from_container<class_EditorPlugin_remove_control_from_container>` **(** :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>` container, :ref:`Control<class_Control>` control **)** |
  90. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`remove_control_from_docks<class_EditorPlugin_remove_control_from_docks>` **(** :ref:`Control<class_Control>` control **)** |
  92. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`remove_custom_type<class_EditorPlugin_remove_custom_type>` **(** :ref:`String<class_String>` type **)** |
  94. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`remove_export_plugin<class_EditorPlugin_remove_export_plugin>` **(** :ref:`EditorExportPlugin<class_EditorExportPlugin>` plugin **)** |
  96. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`remove_import_plugin<class_EditorPlugin_remove_import_plugin>` **(** :ref:`EditorImportPlugin<class_EditorImportPlugin>` importer **)** |
  98. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`remove_inspector_plugin<class_EditorPlugin_remove_inspector_plugin>` **(** :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` plugin **)** |
  100. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`remove_scene_import_plugin<class_EditorPlugin_remove_scene_import_plugin>` **(** :ref:`EditorSceneImporter<class_EditorSceneImporter>` scene_importer **)** |
  102. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`remove_tool_menu_item<class_EditorPlugin_remove_tool_menu_item>` **(** :ref:`String<class_String>` name **)** |
  104. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`save_external_data<class_EditorPlugin_save_external_data>` **(** **)** virtual |
  106. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`set_force_draw_over_forwarding_enabled<class_EditorPlugin_set_force_draw_over_forwarding_enabled>` **(** **)** |
  108. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`set_input_event_forwarding_always_enabled<class_EditorPlugin_set_input_event_forwarding_always_enabled>` **(** **)** |
  110. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`set_state<class_EditorPlugin_set_state>` **(** :ref:`Dictionary<class_Dictionary>` state **)** virtual |
  112. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`set_window_layout<class_EditorPlugin_set_window_layout>` **(** :ref:`ConfigFile<class_ConfigFile>` layout **)** virtual |
  114. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`int<class_int>` | :ref:`update_overlays<class_EditorPlugin_update_overlays>` **(** **)** const |
  116. +------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. Signals
  118. -------
  119. .. _class_EditorPlugin_main_screen_changed:
  120. - **main_screen_changed** **(** :ref:`String<class_String>` screen_name **)**
  121. Emitted when user changes the workspace (2D, 3D, Script, AssetLib). Also works with custom screens defined by plugins.
  122. .. _class_EditorPlugin_resource_saved:
  123. - **resource_saved** **(** :ref:`Resource<class_Resource>` resource **)**
  124. .. _class_EditorPlugin_scene_changed:
  125. - **scene_changed** **(** :ref:`Node<class_Node>` scene_root **)**
  126. 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.
  127. .. _class_EditorPlugin_scene_closed:
  128. - **scene_closed** **(** :ref:`String<class_String>` filepath **)**
  129. Emitted when user closes a scene. The argument is file path to a closed scene.
  130. Enumerations
  131. ------------
  132. .. _enum_EditorPlugin_CustomControlContainer:
  133. enum **CustomControlContainer**:
  134. - **CONTAINER_TOOLBAR** = **0**
  135. - **CONTAINER_SPATIAL_EDITOR_MENU** = **1**
  136. - **CONTAINER_SPATIAL_EDITOR_SIDE_LEFT** = **2**
  137. - **CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT** = **3**
  138. - **CONTAINER_SPATIAL_EDITOR_BOTTOM** = **4**
  139. - **CONTAINER_CANVAS_EDITOR_MENU** = **5**
  140. - **CONTAINER_CANVAS_EDITOR_SIDE_LEFT** = **6**
  141. - **CONTAINER_CANVAS_EDITOR_SIDE_RIGHT** = **7**
  142. - **CONTAINER_CANVAS_EDITOR_BOTTOM** = **8**
  143. - **CONTAINER_PROPERTY_EDITOR_BOTTOM** = **9**
  144. .. _enum_EditorPlugin_DockSlot:
  145. enum **DockSlot**:
  146. - **DOCK_SLOT_LEFT_UL** = **0**
  147. - **DOCK_SLOT_LEFT_BL** = **1**
  148. - **DOCK_SLOT_LEFT_UR** = **2**
  149. - **DOCK_SLOT_LEFT_BR** = **3**
  150. - **DOCK_SLOT_RIGHT_UL** = **4**
  151. - **DOCK_SLOT_RIGHT_BL** = **5**
  152. - **DOCK_SLOT_RIGHT_UR** = **6**
  153. - **DOCK_SLOT_RIGHT_BR** = **7**
  154. - **DOCK_SLOT_MAX** = **8**
  155. Description
  156. -----------
  157. 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. Also see :ref:`EditorScript<class_EditorScript>` to add functions to the editor.
  158. Tutorials
  159. ---------
  160. - :doc:`../development/plugins/index`
  161. Method Descriptions
  162. -------------------
  163. .. _class_EditorPlugin_add_autoload_singleton:
  164. - void **add_autoload_singleton** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` path **)**
  165. Add a script at ``path`` to the Autoload list as ``name``.
  166. .. _class_EditorPlugin_add_control_to_bottom_panel:
  167. - :ref:`ToolButton<class_ToolButton>` **add_control_to_bottom_panel** **(** :ref:`Control<class_Control>` control, :ref:`String<class_String>` title **)**
  168. Add 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_remove_control_from_bottom_panel>` and free it with ``queue_free()``.
  169. .. _class_EditorPlugin_add_control_to_container:
  170. - void **add_control_to_container** **(** :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>` container, :ref:`Control<class_Control>` control **)**
  171. Add a custom control to a container (see CONTAINER\_\* enum). There are many locations where custom controls can be added in the editor UI.
  172. Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it).
  173. When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_container<class_EditorPlugin_remove_control_from_container>` and free it with ``queue_free()``.
  174. .. _class_EditorPlugin_add_control_to_dock:
  175. - void **add_control_to_dock** **(** :ref:`DockSlot<enum_EditorPlugin_DockSlot>` slot, :ref:`Control<class_Control>` control **)**
  176. Add the control to a specific dock slot (see DOCK\_\* enum for options).
  177. If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions.
  178. When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_docks<class_EditorPlugin_remove_control_from_docks>` and free it with ``queue_free()``.
  179. .. _class_EditorPlugin_add_custom_type:
  180. - void **add_custom_type** **(** :ref:`String<class_String>` type, :ref:`String<class_String>` base, :ref:`Script<class_Script>` script, :ref:`Texture<class_Texture>` icon **)**
  181. Add a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.
  182. When given node or resource is selected, the base type will be instanced (ie, "Spatial", "Control", "Resource"), then the script will be loaded and set to this object.
  183. You can use the virtual method :ref:`handles<class_EditorPlugin_handles>` to check if your custom object is being edited by checking the script or using 'is' keyword.
  184. During run-time, this will be a simple object with a script so this function does not need to be called then.
  185. .. _class_EditorPlugin_add_export_plugin:
  186. - void **add_export_plugin** **(** :ref:`EditorExportPlugin<class_EditorExportPlugin>` plugin **)**
  187. .. _class_EditorPlugin_add_import_plugin:
  188. - void **add_import_plugin** **(** :ref:`EditorImportPlugin<class_EditorImportPlugin>` importer **)**
  189. .. _class_EditorPlugin_add_inspector_plugin:
  190. - void **add_inspector_plugin** **(** :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` plugin **)**
  191. .. _class_EditorPlugin_add_scene_import_plugin:
  192. - void **add_scene_import_plugin** **(** :ref:`EditorSceneImporter<class_EditorSceneImporter>` scene_importer **)**
  193. .. _class_EditorPlugin_add_tool_menu_item:
  194. - void **add_tool_menu_item** **(** :ref:`String<class_String>` name, :ref:`Object<class_Object>` handler, :ref:`String<class_String>` callback, :ref:`Variant<class_Variant>` ud=null **)**
  195. Add a custom menu to 'Project > Tools' as ``name`` that calls ``callback`` on an instance of ``handler`` with a parameter ``ud`` when user activates it.
  196. .. _class_EditorPlugin_add_tool_submenu_item:
  197. - void **add_tool_submenu_item** **(** :ref:`String<class_String>` name, :ref:`Object<class_Object>` submenu **)**
  198. Like :ref:`add_tool_menu_item<class_EditorPlugin_add_tool_menu_item>` but adds the ``submenu`` item inside the ``name`` menu.
  199. .. _class_EditorPlugin_apply_changes:
  200. - void **apply_changes** **(** **)** virtual
  201. 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.
  202. 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.
  203. .. _class_EditorPlugin_build:
  204. - :ref:`bool<class_bool>` **build** **(** **)** virtual
  205. .. _class_EditorPlugin_clear:
  206. - void **clear** **(** **)** virtual
  207. 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.
  208. .. _class_EditorPlugin_disable_plugin:
  209. - void **disable_plugin** **(** **)** virtual
  210. .. _class_EditorPlugin_edit:
  211. - void **edit** **(** :ref:`Object<class_Object>` object **)** virtual
  212. This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object.
  213. .. _class_EditorPlugin_enable_plugin:
  214. - void **enable_plugin** **(** **)** virtual
  215. .. _class_EditorPlugin_forward_canvas_draw_over_viewport:
  216. - void **forward_canvas_draw_over_viewport** **(** :ref:`Control<class_Control>` overlay **)** virtual
  217. This method is called when there is an input event in the 2D viewport, e.g. the user clicks with the mouse in the 2D space (canvas GUI). Keep in mind that for this method to be called you have to first declare the virtual method :ref:`handles<class_EditorPlugin_handles>` so the editor knows that you want to work with the workspace:
  218. ::
  219. func handles(object):
  220. return true
  221. Also note that the edited scene must have a root node.
  222. .. _class_EditorPlugin_forward_canvas_force_draw_over_viewport:
  223. - void **forward_canvas_force_draw_over_viewport** **(** :ref:`Control<class_Control>` overlay **)** virtual
  224. .. _class_EditorPlugin_forward_canvas_gui_input:
  225. - :ref:`bool<class_bool>` **forward_canvas_gui_input** **(** :ref:`InputEvent<class_InputEvent>` event **)** virtual
  226. .. _class_EditorPlugin_forward_spatial_gui_input:
  227. - :ref:`bool<class_bool>` **forward_spatial_gui_input** **(** :ref:`Camera<class_Camera>` camera, :ref:`InputEvent<class_InputEvent>` event **)** virtual
  228. This method is called when there is an input event in the 3D viewport, e.g. the user clicks with the mouse in the 3D space (spatial GUI). Keep in mind that for this method to be called you have to first declare the virtual method :ref:`handles<class_EditorPlugin_handles>` so the editor knows that you want to work with the workspace:
  229. ::
  230. func handles(object):
  231. return true
  232. Also note that the edited scene must have a root node.
  233. .. _class_EditorPlugin_get_breakpoints:
  234. - :ref:`PoolStringArray<class_PoolStringArray>` **get_breakpoints** **(** **)** virtual
  235. 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
  236. .. _class_EditorPlugin_get_editor_interface:
  237. - :ref:`EditorInterface<class_EditorInterface>` **get_editor_interface** **(** **)**
  238. Return the :ref:`EditorInterface<class_EditorInterface>` object that gives you control over Godot editor's window and its functionalities.
  239. .. _class_EditorPlugin_get_plugin_icon:
  240. - :ref:`Object<class_Object>` **get_plugin_icon** **(** **)** virtual
  241. .. _class_EditorPlugin_get_plugin_name:
  242. - :ref:`String<class_String>` **get_plugin_name** **(** **)** virtual
  243. .. _class_EditorPlugin_get_script_create_dialog:
  244. - :ref:`ScriptCreateDialog<class_ScriptCreateDialog>` **get_script_create_dialog** **(** **)**
  245. Gets the Editor's dialogue used for making scripts. Note that users can configure it before use.
  246. .. _class_EditorPlugin_get_state:
  247. - :ref:`Dictionary<class_Dictionary>` **get_state** **(** **)** virtual
  248. Get 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).
  249. .. _class_EditorPlugin_get_undo_redo:
  250. - :ref:`UndoRedo<class_UndoRedo>` **get_undo_redo** **(** **)**
  251. Get 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.
  252. .. _class_EditorPlugin_get_window_layout:
  253. - void **get_window_layout** **(** :ref:`ConfigFile<class_ConfigFile>` layout **)** virtual
  254. Get the GUI layout of the plugin. This is used to save the project's editor layout when :ref:`queue_save_layout<class_EditorPlugin_queue_save_layout>` is called or the editor layout was changed(For example changing the position of a dock).
  255. .. _class_EditorPlugin_handles:
  256. - :ref:`bool<class_bool>` **handles** **(** :ref:`Object<class_Object>` object **)** virtual
  257. 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:`EditorPlugin.edit<class_EditorPlugin_edit>` and :ref:`EditorPlugin.make_visible<class_EditorPlugin_make_visible>` called when the editor requests them. If you have declared the methods :ref:`forward_canvas_gui_input<class_EditorPlugin_forward_canvas_gui_input>` and :ref:`forward_spatial_gui_input<class_EditorPlugin_forward_spatial_gui_input>` these will be called too.
  258. .. _class_EditorPlugin_has_main_screen:
  259. - :ref:`bool<class_bool>` **has_main_screen** **(** **)** virtual
  260. Return true if this is a main screen editor plugin (it goes in the workspaces selector together with '2D', '3D', and 'Script').
  261. .. _class_EditorPlugin_hide_bottom_panel:
  262. - void **hide_bottom_panel** **(** **)**
  263. .. _class_EditorPlugin_make_bottom_panel_item_visible:
  264. - void **make_bottom_panel_item_visible** **(** :ref:`Control<class_Control>` item **)**
  265. .. _class_EditorPlugin_make_visible:
  266. - void **make_visible** **(** :ref:`bool<class_bool>` visible **)** virtual
  267. This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type.
  268. Remember that you have to manage the visibility of all your editor controls manually.
  269. .. _class_EditorPlugin_queue_save_layout:
  270. - void **queue_save_layout** **(** **)** const
  271. Queue save the project's editor layout.
  272. .. _class_EditorPlugin_remove_autoload_singleton:
  273. - void **remove_autoload_singleton** **(** :ref:`String<class_String>` name **)**
  274. Remove an Autoload ``name`` from the list.
  275. .. _class_EditorPlugin_remove_control_from_bottom_panel:
  276. - void **remove_control_from_bottom_panel** **(** :ref:`Control<class_Control>` control **)**
  277. Remove the control from the bottom panel. You have to manually ``queue_free()`` the control.
  278. .. _class_EditorPlugin_remove_control_from_container:
  279. - void **remove_control_from_container** **(** :ref:`CustomControlContainer<enum_EditorPlugin_CustomControlContainer>` container, :ref:`Control<class_Control>` control **)**
  280. Remove the control from the specified container. You have to manually ``queue_free()`` the control.
  281. .. _class_EditorPlugin_remove_control_from_docks:
  282. - void **remove_control_from_docks** **(** :ref:`Control<class_Control>` control **)**
  283. Remove the control from the dock. You have to manually ``queue_free()`` the control.
  284. .. _class_EditorPlugin_remove_custom_type:
  285. - void **remove_custom_type** **(** :ref:`String<class_String>` type **)**
  286. Remove a custom type added by :ref:`add_custom_type<class_EditorPlugin_add_custom_type>`
  287. .. _class_EditorPlugin_remove_export_plugin:
  288. - void **remove_export_plugin** **(** :ref:`EditorExportPlugin<class_EditorExportPlugin>` plugin **)**
  289. .. _class_EditorPlugin_remove_import_plugin:
  290. - void **remove_import_plugin** **(** :ref:`EditorImportPlugin<class_EditorImportPlugin>` importer **)**
  291. .. _class_EditorPlugin_remove_inspector_plugin:
  292. - void **remove_inspector_plugin** **(** :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` plugin **)**
  293. .. _class_EditorPlugin_remove_scene_import_plugin:
  294. - void **remove_scene_import_plugin** **(** :ref:`EditorSceneImporter<class_EditorSceneImporter>` scene_importer **)**
  295. .. _class_EditorPlugin_remove_tool_menu_item:
  296. - void **remove_tool_menu_item** **(** :ref:`String<class_String>` name **)**
  297. Removes a menu ``name`` from 'Project > Tools'.
  298. .. _class_EditorPlugin_save_external_data:
  299. - void **save_external_data** **(** **)** virtual
  300. 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.
  301. .. _class_EditorPlugin_set_force_draw_over_forwarding_enabled:
  302. - void **set_force_draw_over_forwarding_enabled** **(** **)**
  303. .. _class_EditorPlugin_set_input_event_forwarding_always_enabled:
  304. - void **set_input_event_forwarding_always_enabled** **(** **)**
  305. Use this method if you always want to receive inputs from 3D view screen inside :ref:`forward_spatial_gui_input<class_EditorPlugin_forward_spatial_gui_input>`. It might be especially usable if your plugin will want to use raycast in the scene.
  306. .. _class_EditorPlugin_set_state:
  307. - void **set_state** **(** :ref:`Dictionary<class_Dictionary>` state **)** virtual
  308. Restore the state saved by :ref:`EditorPlugin.get_state<class_EditorPlugin_get_state>`.
  309. .. _class_EditorPlugin_set_window_layout:
  310. - void **set_window_layout** **(** :ref:`ConfigFile<class_ConfigFile>` layout **)** virtual
  311. Restore the plugin GUI layout saved by :ref:`EditorPlugin.get_window_layout<class_EditorPlugin_get_window_layout>`.
  312. .. _class_EditorPlugin_update_overlays:
  313. - :ref:`int<class_int>` **update_overlays** **(** **)** const