class_editorinterface.rst 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EditorInterface.xml.
  6. .. _class_EditorInterface:
  7. EditorInterface
  8. ===============
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Godot editor's interface.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **EditorInterface** gives you control over Godot editor's window. It allows customizing the window, saving and (re-)loading scenes, rendering mesh previews, inspecting and editing resources and objects, and provides access to :ref:`EditorSettings<class_EditorSettings>`, :ref:`EditorFileSystem<class_EditorFileSystem>`, :ref:`EditorResourcePreview<class_EditorResourcePreview>`, :ref:`ScriptEditor<class_ScriptEditor>`, the editor viewport, and information about scenes.
  15. \ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton directly by its name.
  16. .. tabs::
  17. .. code-tab:: gdscript
  18. var editor_settings = EditorInterface.get_editor_settings()
  19. .. code-tab:: csharp
  20. // In C# you can access it via the static Singleton property.
  21. EditorSettings settings = EditorInterface.Singleton.GetEditorSettings();
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +-------------------------+------------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`distraction_free_mode<class_EditorInterface_property_distraction_free_mode>` |
  29. +-------------------------+------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`movie_maker_enabled<class_EditorInterface_property_movie_maker_enabled>` |
  31. +-------------------------+------------------------------------------------------------------------------------+
  32. .. rst-class:: classref-reftable-group
  33. Methods
  34. -------
  35. .. table::
  36. :widths: auto
  37. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | |void| | :ref:`add_root_node<class_EditorInterface_method_add_root_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
  39. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`close_scene<class_EditorInterface_method_close_scene>`\ (\ ) |
  41. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | |void| | :ref:`edit_node<class_EditorInterface_method_edit_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
  43. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | |void| | :ref:`edit_resource<class_EditorInterface_method_edit_resource>`\ (\ resource\: :ref:`Resource<class_Resource>`\ ) |
  45. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | |void| | :ref:`edit_script<class_EditorInterface_method_edit_script>`\ (\ script\: :ref:`Script<class_Script>`, line\: :ref:`int<class_int>` = -1, column\: :ref:`int<class_int>` = 0, grab_focus\: :ref:`bool<class_bool>` = true\ ) |
  47. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Control<class_Control>` | :ref:`get_base_control<class_EditorInterface_method_get_base_control>`\ (\ ) |const| |
  49. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`EditorCommandPalette<class_EditorCommandPalette>` | :ref:`get_command_palette<class_EditorInterface_method_get_command_palette>`\ (\ ) |const| |
  51. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`String<class_String>` | :ref:`get_current_directory<class_EditorInterface_method_get_current_directory>`\ (\ ) |const| |
  53. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`String<class_String>` | :ref:`get_current_feature_profile<class_EditorInterface_method_get_current_feature_profile>`\ (\ ) |const| |
  55. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`String<class_String>` | :ref:`get_current_path<class_EditorInterface_method_get_current_path>`\ (\ ) |const| |
  57. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Node<class_Node>` | :ref:`get_edited_scene_root<class_EditorInterface_method_get_edited_scene_root>`\ (\ ) |const| |
  59. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`VBoxContainer<class_VBoxContainer>` | :ref:`get_editor_main_screen<class_EditorInterface_method_get_editor_main_screen>`\ (\ ) |const| |
  61. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`EditorPaths<class_EditorPaths>` | :ref:`get_editor_paths<class_EditorInterface_method_get_editor_paths>`\ (\ ) |const| |
  63. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`float<class_float>` | :ref:`get_editor_scale<class_EditorInterface_method_get_editor_scale>`\ (\ ) |const| |
  65. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`EditorSettings<class_EditorSettings>` | :ref:`get_editor_settings<class_EditorInterface_method_get_editor_settings>`\ (\ ) |const| |
  67. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Theme<class_Theme>` | :ref:`get_editor_theme<class_EditorInterface_method_get_editor_theme>`\ (\ ) |const| |
  69. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`EditorToaster<class_EditorToaster>` | :ref:`get_editor_toaster<class_EditorInterface_method_get_editor_toaster>`\ (\ ) |const| |
  71. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>` | :ref:`get_editor_undo_redo<class_EditorInterface_method_get_editor_undo_redo>`\ (\ ) |const| |
  73. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`SubViewport<class_SubViewport>` | :ref:`get_editor_viewport_2d<class_EditorInterface_method_get_editor_viewport_2d>`\ (\ ) |const| |
  75. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`SubViewport<class_SubViewport>` | :ref:`get_editor_viewport_3d<class_EditorInterface_method_get_editor_viewport_3d>`\ (\ idx\: :ref:`int<class_int>` = 0\ ) |const| |
  77. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`FileSystemDock<class_FileSystemDock>` | :ref:`get_file_system_dock<class_EditorInterface_method_get_file_system_dock>`\ (\ ) |const| |
  79. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`EditorInspector<class_EditorInspector>` | :ref:`get_inspector<class_EditorInterface_method_get_inspector>`\ (\ ) |const| |
  81. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`float<class_float>` | :ref:`get_node_3d_rotate_snap<class_EditorInterface_method_get_node_3d_rotate_snap>`\ (\ ) |const| |
  83. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`float<class_float>` | :ref:`get_node_3d_scale_snap<class_EditorInterface_method_get_node_3d_scale_snap>`\ (\ ) |const| |
  85. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`float<class_float>` | :ref:`get_node_3d_translate_snap<class_EditorInterface_method_get_node_3d_translate_snap>`\ (\ ) |const| |
  87. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_open_scene_roots<class_EditorInterface_method_get_open_scene_roots>`\ (\ ) |const| |
  89. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_open_scenes<class_EditorInterface_method_get_open_scenes>`\ (\ ) |const| |
  91. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`String<class_String>` | :ref:`get_playing_scene<class_EditorInterface_method_get_playing_scene>`\ (\ ) |const| |
  93. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`EditorFileSystem<class_EditorFileSystem>` | :ref:`get_resource_filesystem<class_EditorInterface_method_get_resource_filesystem>`\ (\ ) |const| |
  95. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`EditorResourcePreview<class_EditorResourcePreview>` | :ref:`get_resource_previewer<class_EditorInterface_method_get_resource_previewer>`\ (\ ) |const| |
  97. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`ScriptEditor<class_ScriptEditor>` | :ref:`get_script_editor<class_EditorInterface_method_get_script_editor>`\ (\ ) |const| |
  99. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_selected_paths<class_EditorInterface_method_get_selected_paths>`\ (\ ) |const| |
  101. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`EditorSelection<class_EditorSelection>` | :ref:`get_selection<class_EditorInterface_method_get_selection>`\ (\ ) |const| |
  103. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | |void| | :ref:`inspect_object<class_EditorInterface_method_inspect_object>`\ (\ object\: :ref:`Object<class_Object>`, for_property\: :ref:`String<class_String>` = "", inspector_only\: :ref:`bool<class_bool>` = false\ ) |
  105. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`bool<class_bool>` | :ref:`is_multi_window_enabled<class_EditorInterface_method_is_multi_window_enabled>`\ (\ ) |const| |
  107. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`bool<class_bool>` | :ref:`is_node_3d_snap_enabled<class_EditorInterface_method_is_node_3d_snap_enabled>`\ (\ ) |const| |
  109. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`bool<class_bool>` | :ref:`is_playing_scene<class_EditorInterface_method_is_playing_scene>`\ (\ ) |const| |
  111. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`bool<class_bool>` | :ref:`is_plugin_enabled<class_EditorInterface_method_is_plugin_enabled>`\ (\ plugin\: :ref:`String<class_String>`\ ) |const| |
  113. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`Array<class_Array>`\[:ref:`Texture2D<class_Texture2D>`\] | :ref:`make_mesh_previews<class_EditorInterface_method_make_mesh_previews>`\ (\ meshes\: :ref:`Array<class_Array>`\[:ref:`Mesh<class_Mesh>`\], preview_size\: :ref:`int<class_int>`\ ) |
  115. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | |void| | :ref:`mark_scene_as_unsaved<class_EditorInterface_method_mark_scene_as_unsaved>`\ (\ ) |
  117. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | |void| | :ref:`open_scene_from_path<class_EditorInterface_method_open_scene_from_path>`\ (\ scene_filepath\: :ref:`String<class_String>`, set_inherited\: :ref:`bool<class_bool>` = false\ ) |
  119. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | |void| | :ref:`play_current_scene<class_EditorInterface_method_play_current_scene>`\ (\ ) |
  121. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | |void| | :ref:`play_custom_scene<class_EditorInterface_method_play_custom_scene>`\ (\ scene_filepath\: :ref:`String<class_String>`\ ) |
  123. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | |void| | :ref:`play_main_scene<class_EditorInterface_method_play_main_scene>`\ (\ ) |
  125. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | |void| | :ref:`popup_create_dialog<class_EditorInterface_method_popup_create_dialog>`\ (\ callback\: :ref:`Callable<class_Callable>`, base_type\: :ref:`StringName<class_StringName>` = "", current_type\: :ref:`String<class_String>` = "", dialog_title\: :ref:`String<class_String>` = "", type_blocklist\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) |
  127. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | |void| | :ref:`popup_dialog<class_EditorInterface_method_popup_dialog>`\ (\ dialog\: :ref:`Window<class_Window>`, rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) |
  129. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | |void| | :ref:`popup_dialog_centered<class_EditorInterface_method_popup_dialog_centered>`\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) |
  131. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | |void| | :ref:`popup_dialog_centered_clamped<class_EditorInterface_method_popup_dialog_centered_clamped>`\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0), fallback_ratio\: :ref:`float<class_float>` = 0.75\ ) |
  133. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`popup_dialog_centered_ratio<class_EditorInterface_method_popup_dialog_centered_ratio>`\ (\ dialog\: :ref:`Window<class_Window>`, ratio\: :ref:`float<class_float>` = 0.8\ ) |
  135. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | |void| | :ref:`popup_method_selector<class_EditorInterface_method_popup_method_selector>`\ (\ object\: :ref:`Object<class_Object>`, callback\: :ref:`Callable<class_Callable>`, current_value\: :ref:`String<class_String>` = ""\ ) |
  137. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | |void| | :ref:`popup_node_selector<class_EditorInterface_method_popup_node_selector>`\ (\ callback\: :ref:`Callable<class_Callable>`, valid_types\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = [], current_value\: :ref:`Node<class_Node>` = null\ ) |
  139. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | |void| | :ref:`popup_property_selector<class_EditorInterface_method_popup_property_selector>`\ (\ object\: :ref:`Object<class_Object>`, callback\: :ref:`Callable<class_Callable>`, type_filter\: :ref:`PackedInt32Array<class_PackedInt32Array>` = PackedInt32Array(), current_value\: :ref:`String<class_String>` = ""\ ) |
  141. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`popup_quick_open<class_EditorInterface_method_popup_quick_open>`\ (\ callback\: :ref:`Callable<class_Callable>`, base_types\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) |
  143. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | |void| | :ref:`reload_scene_from_path<class_EditorInterface_method_reload_scene_from_path>`\ (\ scene_filepath\: :ref:`String<class_String>`\ ) |
  145. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | |void| | :ref:`restart_editor<class_EditorInterface_method_restart_editor>`\ (\ save\: :ref:`bool<class_bool>` = true\ ) |
  147. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | |void| | :ref:`save_all_scenes<class_EditorInterface_method_save_all_scenes>`\ (\ ) |
  149. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_scene<class_EditorInterface_method_save_scene>`\ (\ ) |
  151. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | |void| | :ref:`save_scene_as<class_EditorInterface_method_save_scene_as>`\ (\ path\: :ref:`String<class_String>`, with_preview\: :ref:`bool<class_bool>` = true\ ) |
  153. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | |void| | :ref:`select_file<class_EditorInterface_method_select_file>`\ (\ file\: :ref:`String<class_String>`\ ) |
  155. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | |void| | :ref:`set_current_feature_profile<class_EditorInterface_method_set_current_feature_profile>`\ (\ profile_name\: :ref:`String<class_String>`\ ) |
  157. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | |void| | :ref:`set_main_screen_editor<class_EditorInterface_method_set_main_screen_editor>`\ (\ name\: :ref:`String<class_String>`\ ) |
  159. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | |void| | :ref:`set_plugin_enabled<class_EditorInterface_method_set_plugin_enabled>`\ (\ plugin\: :ref:`String<class_String>`, enabled\: :ref:`bool<class_bool>`\ ) |
  161. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | |void| | :ref:`stop_playing_scene<class_EditorInterface_method_stop_playing_scene>`\ (\ ) |
  163. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. .. rst-class:: classref-section-separator
  165. ----
  166. .. rst-class:: classref-descriptions-group
  167. Property Descriptions
  168. ---------------------
  169. .. _class_EditorInterface_property_distraction_free_mode:
  170. .. rst-class:: classref-property
  171. :ref:`bool<class_bool>` **distraction_free_mode** :ref:`๐Ÿ”—<class_EditorInterface_property_distraction_free_mode>`
  172. .. rst-class:: classref-property-setget
  173. - |void| **set_distraction_free_mode**\ (\ value\: :ref:`bool<class_bool>`\ )
  174. - :ref:`bool<class_bool>` **is_distraction_free_mode_enabled**\ (\ )
  175. If ``true``, enables distraction-free mode which hides side docks to increase the space available for the main view.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_EditorInterface_property_movie_maker_enabled:
  179. .. rst-class:: classref-property
  180. :ref:`bool<class_bool>` **movie_maker_enabled** :ref:`๐Ÿ”—<class_EditorInterface_property_movie_maker_enabled>`
  181. .. rst-class:: classref-property-setget
  182. - |void| **set_movie_maker_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  183. - :ref:`bool<class_bool>` **is_movie_maker_enabled**\ (\ )
  184. If ``true``, the Movie Maker mode is enabled in the editor. See :ref:`MovieWriter<class_MovieWriter>` for more information.
  185. .. rst-class:: classref-section-separator
  186. ----
  187. .. rst-class:: classref-descriptions-group
  188. Method Descriptions
  189. -------------------
  190. .. _class_EditorInterface_method_add_root_node:
  191. .. rst-class:: classref-method
  192. |void| **add_root_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_add_root_node>`
  193. Makes ``node`` root of the currently opened scene. Only works if the scene is empty. If the ``node`` is a scene instance, an inheriting scene will be created.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_EditorInterface_method_close_scene:
  197. .. rst-class:: classref-method
  198. :ref:`Error<enum_@GlobalScope_Error>` **close_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_close_scene>`
  199. Closes the currently active scene, discarding any pending changes in the process. Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` on success or :ref:`@GlobalScope.ERR_DOES_NOT_EXIST<class_@GlobalScope_constant_ERR_DOES_NOT_EXIST>` if there is no scene to close.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_EditorInterface_method_edit_node:
  203. .. rst-class:: classref-method
  204. |void| **edit_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_edit_node>`
  205. Edits the given :ref:`Node<class_Node>`. The node will be also selected if it's inside the scene tree.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_EditorInterface_method_edit_resource:
  209. .. rst-class:: classref-method
  210. |void| **edit_resource**\ (\ resource\: :ref:`Resource<class_Resource>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_edit_resource>`
  211. Edits the given :ref:`Resource<class_Resource>`. If the resource is a :ref:`Script<class_Script>` you can also edit it with :ref:`edit_script()<class_EditorInterface_method_edit_script>` to specify the line and column position.
  212. .. rst-class:: classref-item-separator
  213. ----
  214. .. _class_EditorInterface_method_edit_script:
  215. .. rst-class:: classref-method
  216. |void| **edit_script**\ (\ script\: :ref:`Script<class_Script>`, line\: :ref:`int<class_int>` = -1, column\: :ref:`int<class_int>` = 0, grab_focus\: :ref:`bool<class_bool>` = true\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_edit_script>`
  217. Edits the given :ref:`Script<class_Script>`. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor.
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_EditorInterface_method_get_base_control:
  221. .. rst-class:: classref-method
  222. :ref:`Control<class_Control>` **get_base_control**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_base_control>`
  223. Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly.
  224. \ **Warning:** Removing and freeing this node will render the editor useless and may cause a crash.
  225. .. rst-class:: classref-item-separator
  226. ----
  227. .. _class_EditorInterface_method_get_command_palette:
  228. .. rst-class:: classref-method
  229. :ref:`EditorCommandPalette<class_EditorCommandPalette>` **get_command_palette**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_command_palette>`
  230. Returns the editor's :ref:`EditorCommandPalette<class_EditorCommandPalette>` instance.
  231. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  232. .. rst-class:: classref-item-separator
  233. ----
  234. .. _class_EditorInterface_method_get_current_directory:
  235. .. rst-class:: classref-method
  236. :ref:`String<class_String>` **get_current_directory**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_current_directory>`
  237. Returns the current directory being viewed in the :ref:`FileSystemDock<class_FileSystemDock>`. If a file is selected, its base directory will be returned using :ref:`String.get_base_dir()<class_String_method_get_base_dir>` instead.
  238. .. rst-class:: classref-item-separator
  239. ----
  240. .. _class_EditorInterface_method_get_current_feature_profile:
  241. .. rst-class:: classref-method
  242. :ref:`String<class_String>` **get_current_feature_profile**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_current_feature_profile>`
  243. Returns the name of the currently activated feature profile. If the default profile is currently active, an empty string is returned instead.
  244. In order to get a reference to the :ref:`EditorFeatureProfile<class_EditorFeatureProfile>`, you must load the feature profile using :ref:`EditorFeatureProfile.load_from_file()<class_EditorFeatureProfile_method_load_from_file>`.
  245. \ **Note:** Feature profiles created via the user interface are loaded from the ``feature_profiles`` directory, as a file with the ``.profile`` extension. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir()<class_EditorPaths_method_get_config_dir>`.
  246. .. rst-class:: classref-item-separator
  247. ----
  248. .. _class_EditorInterface_method_get_current_path:
  249. .. rst-class:: classref-method
  250. :ref:`String<class_String>` **get_current_path**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_current_path>`
  251. Returns the current path being viewed in the :ref:`FileSystemDock<class_FileSystemDock>`.
  252. .. rst-class:: classref-item-separator
  253. ----
  254. .. _class_EditorInterface_method_get_edited_scene_root:
  255. .. rst-class:: classref-method
  256. :ref:`Node<class_Node>` **get_edited_scene_root**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_edited_scene_root>`
  257. Returns the edited (current) scene's root :ref:`Node<class_Node>`.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_EditorInterface_method_get_editor_main_screen:
  261. .. rst-class:: classref-method
  262. :ref:`VBoxContainer<class_VBoxContainer>` **get_editor_main_screen**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_main_screen>`
  263. Returns the editor control responsible for main screen plugins and tools. Use it with plugins that implement :ref:`EditorPlugin._has_main_screen()<class_EditorPlugin_private_method__has_main_screen>`.
  264. \ **Note:** This node is a :ref:`VBoxContainer<class_VBoxContainer>`, which means that if you add a :ref:`Control<class_Control>` child to it, you need to set the child's :ref:`Control.size_flags_vertical<class_Control_property_size_flags_vertical>` to :ref:`Control.SIZE_EXPAND_FILL<class_Control_constant_SIZE_EXPAND_FILL>` to make it use the full available space.
  265. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  266. .. rst-class:: classref-item-separator
  267. ----
  268. .. _class_EditorInterface_method_get_editor_paths:
  269. .. rst-class:: classref-method
  270. :ref:`EditorPaths<class_EditorPaths>` **get_editor_paths**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_paths>`
  271. Returns the :ref:`EditorPaths<class_EditorPaths>` singleton.
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _class_EditorInterface_method_get_editor_scale:
  275. .. rst-class:: classref-method
  276. :ref:`float<class_float>` **get_editor_scale**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_scale>`
  277. Returns the actual scale of the editor UI (``1.0`` being 100% scale). This can be used to adjust position and dimensions of the UI added by plugins.
  278. \ **Note:** This value is set via the :ref:`EditorSettings.interface/editor/display_scale<class_EditorSettings_property_interface/editor/display_scale>` and :ref:`EditorSettings.interface/editor/custom_display_scale<class_EditorSettings_property_interface/editor/custom_display_scale>` settings. The editor must be restarted for changes to be properly applied.
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_EditorInterface_method_get_editor_settings:
  282. .. rst-class:: classref-method
  283. :ref:`EditorSettings<class_EditorSettings>` **get_editor_settings**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_settings>`
  284. Returns the editor's :ref:`EditorSettings<class_EditorSettings>` instance.
  285. .. rst-class:: classref-item-separator
  286. ----
  287. .. _class_EditorInterface_method_get_editor_theme:
  288. .. rst-class:: classref-method
  289. :ref:`Theme<class_Theme>` **get_editor_theme**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_theme>`
  290. Returns the editor's :ref:`Theme<class_Theme>`.
  291. \ **Note:** When creating custom editor UI, prefer accessing theme items directly from your GUI nodes using the ``get_theme_*`` methods.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_EditorInterface_method_get_editor_toaster:
  295. .. rst-class:: classref-method
  296. :ref:`EditorToaster<class_EditorToaster>` **get_editor_toaster**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_toaster>`
  297. Returns the editor's :ref:`EditorToaster<class_EditorToaster>`.
  298. .. rst-class:: classref-item-separator
  299. ----
  300. .. _class_EditorInterface_method_get_editor_undo_redo:
  301. .. rst-class:: classref-method
  302. :ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>` **get_editor_undo_redo**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_undo_redo>`
  303. Returns the editor's :ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>`.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_EditorInterface_method_get_editor_viewport_2d:
  307. .. rst-class:: classref-method
  308. :ref:`SubViewport<class_SubViewport>` **get_editor_viewport_2d**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_viewport_2d>`
  309. Returns the 2D editor :ref:`SubViewport<class_SubViewport>`. It does not have a camera. Instead, the view transforms are done directly and can be accessed with :ref:`Viewport.global_canvas_transform<class_Viewport_property_global_canvas_transform>`.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_EditorInterface_method_get_editor_viewport_3d:
  313. .. rst-class:: classref-method
  314. :ref:`SubViewport<class_SubViewport>` **get_editor_viewport_3d**\ (\ idx\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_viewport_3d>`
  315. Returns the specified 3D editor :ref:`SubViewport<class_SubViewport>`, from ``0`` to ``3``. The viewport can be used to access the active editor cameras with :ref:`Viewport.get_camera_3d()<class_Viewport_method_get_camera_3d>`.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_EditorInterface_method_get_file_system_dock:
  319. .. rst-class:: classref-method
  320. :ref:`FileSystemDock<class_FileSystemDock>` **get_file_system_dock**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_file_system_dock>`
  321. Returns the editor's :ref:`FileSystemDock<class_FileSystemDock>` instance.
  322. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  323. .. rst-class:: classref-item-separator
  324. ----
  325. .. _class_EditorInterface_method_get_inspector:
  326. .. rst-class:: classref-method
  327. :ref:`EditorInspector<class_EditorInspector>` **get_inspector**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_inspector>`
  328. Returns the editor's :ref:`EditorInspector<class_EditorInspector>` instance.
  329. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_EditorInterface_method_get_node_3d_rotate_snap:
  333. .. rst-class:: classref-method
  334. :ref:`float<class_float>` **get_node_3d_rotate_snap**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_node_3d_rotate_snap>`
  335. Returns the amount of degrees the 3D editor's rotational snapping is set to.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_EditorInterface_method_get_node_3d_scale_snap:
  339. .. rst-class:: classref-method
  340. :ref:`float<class_float>` **get_node_3d_scale_snap**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_node_3d_scale_snap>`
  341. Returns the amount of units the 3D editor's scale snapping is set to.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_EditorInterface_method_get_node_3d_translate_snap:
  345. .. rst-class:: classref-method
  346. :ref:`float<class_float>` **get_node_3d_translate_snap**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_node_3d_translate_snap>`
  347. Returns the amount of units the 3D editor's translation snapping is set to.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_EditorInterface_method_get_open_scene_roots:
  351. .. rst-class:: classref-method
  352. :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_open_scene_roots**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_open_scene_roots>`
  353. Returns an array with references to the root nodes of the currently opened scenes.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_EditorInterface_method_get_open_scenes:
  357. .. rst-class:: classref-method
  358. :ref:`PackedStringArray<class_PackedStringArray>` **get_open_scenes**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_open_scenes>`
  359. Returns an array with the file paths of the currently opened scenes.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_EditorInterface_method_get_playing_scene:
  363. .. rst-class:: classref-method
  364. :ref:`String<class_String>` **get_playing_scene**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_playing_scene>`
  365. Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_EditorInterface_method_get_resource_filesystem:
  369. .. rst-class:: classref-method
  370. :ref:`EditorFileSystem<class_EditorFileSystem>` **get_resource_filesystem**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_resource_filesystem>`
  371. Returns the editor's :ref:`EditorFileSystem<class_EditorFileSystem>` instance.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_EditorInterface_method_get_resource_previewer:
  375. .. rst-class:: classref-method
  376. :ref:`EditorResourcePreview<class_EditorResourcePreview>` **get_resource_previewer**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_resource_previewer>`
  377. Returns the editor's :ref:`EditorResourcePreview<class_EditorResourcePreview>` instance.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_EditorInterface_method_get_script_editor:
  381. .. rst-class:: classref-method
  382. :ref:`ScriptEditor<class_ScriptEditor>` **get_script_editor**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_script_editor>`
  383. Returns the editor's :ref:`ScriptEditor<class_ScriptEditor>` instance.
  384. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  385. .. rst-class:: classref-item-separator
  386. ----
  387. .. _class_EditorInterface_method_get_selected_paths:
  388. .. rst-class:: classref-method
  389. :ref:`PackedStringArray<class_PackedStringArray>` **get_selected_paths**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_selected_paths>`
  390. Returns an array containing the paths of the currently selected files (and directories) in the :ref:`FileSystemDock<class_FileSystemDock>`.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_EditorInterface_method_get_selection:
  394. .. rst-class:: classref-method
  395. :ref:`EditorSelection<class_EditorSelection>` **get_selection**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_selection>`
  396. Returns the editor's :ref:`EditorSelection<class_EditorSelection>` instance.
  397. .. rst-class:: classref-item-separator
  398. ----
  399. .. _class_EditorInterface_method_inspect_object:
  400. .. rst-class:: classref-method
  401. |void| **inspect_object**\ (\ object\: :ref:`Object<class_Object>`, for_property\: :ref:`String<class_String>` = "", inspector_only\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_inspect_object>`
  402. Shows the given property on the given ``object`` in the editor's Inspector dock. If ``inspector_only`` is ``true``, plugins will not attempt to edit ``object``.
  403. .. rst-class:: classref-item-separator
  404. ----
  405. .. _class_EditorInterface_method_is_multi_window_enabled:
  406. .. rst-class:: classref-method
  407. :ref:`bool<class_bool>` **is_multi_window_enabled**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_is_multi_window_enabled>`
  408. Returns ``true`` if multiple window support is enabled in the editor. Multiple window support is enabled if *all* of these statements are true:
  409. - :ref:`EditorSettings.interface/multi_window/enable<class_EditorSettings_property_interface/multi_window/enable>` is ``true``.
  410. - :ref:`EditorSettings.interface/editor/single_window_mode<class_EditorSettings_property_interface/editor/single_window_mode>` is ``false``.
  411. - :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>` is ``false``. This is forced to ``true`` on platforms that don't support multiple windows such as Web, or when the ``--single-window`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>` is used.
  412. .. rst-class:: classref-item-separator
  413. ----
  414. .. _class_EditorInterface_method_is_node_3d_snap_enabled:
  415. .. rst-class:: classref-method
  416. :ref:`bool<class_bool>` **is_node_3d_snap_enabled**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_is_node_3d_snap_enabled>`
  417. Returns ``true`` if the 3D editor currently has snapping mode enabled, and ``false`` otherwise.
  418. .. rst-class:: classref-item-separator
  419. ----
  420. .. _class_EditorInterface_method_is_playing_scene:
  421. .. rst-class:: classref-method
  422. :ref:`bool<class_bool>` **is_playing_scene**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_is_playing_scene>`
  423. Returns ``true`` if a scene is currently being played, ``false`` otherwise. Paused scenes are considered as being played.
  424. .. rst-class:: classref-item-separator
  425. ----
  426. .. _class_EditorInterface_method_is_plugin_enabled:
  427. .. rst-class:: classref-method
  428. :ref:`bool<class_bool>` **is_plugin_enabled**\ (\ plugin\: :ref:`String<class_String>`\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_is_plugin_enabled>`
  429. Returns ``true`` if the specified ``plugin`` is enabled. The plugin name is the same as its directory name.
  430. .. rst-class:: classref-item-separator
  431. ----
  432. .. _class_EditorInterface_method_make_mesh_previews:
  433. .. rst-class:: classref-method
  434. :ref:`Array<class_Array>`\[:ref:`Texture2D<class_Texture2D>`\] **make_mesh_previews**\ (\ meshes\: :ref:`Array<class_Array>`\[:ref:`Mesh<class_Mesh>`\], preview_size\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_make_mesh_previews>`
  435. Returns mesh previews rendered at the given size as an :ref:`Array<class_Array>` of :ref:`Texture2D<class_Texture2D>`\ s.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_EditorInterface_method_mark_scene_as_unsaved:
  439. .. rst-class:: classref-method
  440. |void| **mark_scene_as_unsaved**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_mark_scene_as_unsaved>`
  441. Marks the current scene tab as unsaved.
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_EditorInterface_method_open_scene_from_path:
  445. .. rst-class:: classref-method
  446. |void| **open_scene_from_path**\ (\ scene_filepath\: :ref:`String<class_String>`, set_inherited\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_open_scene_from_path>`
  447. Opens the scene at the given path. If ``set_inherited`` is ``true``, creates a new inherited scene.
  448. .. rst-class:: classref-item-separator
  449. ----
  450. .. _class_EditorInterface_method_play_current_scene:
  451. .. rst-class:: classref-method
  452. |void| **play_current_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_play_current_scene>`
  453. Plays the currently active scene.
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _class_EditorInterface_method_play_custom_scene:
  457. .. rst-class:: classref-method
  458. |void| **play_custom_scene**\ (\ scene_filepath\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_play_custom_scene>`
  459. Plays the scene specified by its filepath.
  460. .. rst-class:: classref-item-separator
  461. ----
  462. .. _class_EditorInterface_method_play_main_scene:
  463. .. rst-class:: classref-method
  464. |void| **play_main_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_play_main_scene>`
  465. Plays the main scene.
  466. .. rst-class:: classref-item-separator
  467. ----
  468. .. _class_EditorInterface_method_popup_create_dialog:
  469. .. rst-class:: classref-method
  470. |void| **popup_create_dialog**\ (\ callback\: :ref:`Callable<class_Callable>`, base_type\: :ref:`StringName<class_StringName>` = "", current_type\: :ref:`String<class_String>` = "", dialog_title\: :ref:`String<class_String>` = "", type_blocklist\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_create_dialog>`
  471. **Experimental:** This method may be changed or removed in future versions.
  472. Pops up an editor dialog for creating an object.
  473. The ``callback`` must take a single argument of type :ref:`StringName<class_StringName>` which will contain the type name of the selected object or be empty if no item is selected.
  474. The ``base_type`` specifies the base type of objects to display. For example, if you set this to "Resource", all types derived from :ref:`Resource<class_Resource>` will display in the create dialog.
  475. The ``current_type`` will be passed in the search box of the create dialog, and the specified type can be immediately selected when the dialog pops up. If the ``current_type`` is not derived from ``base_type``, there will be no result of the type in the dialog.
  476. The ``dialog_title`` allows you to define a custom title for the dialog. This is useful if you want to accurately hint the usage of the dialog. If the ``dialog_title`` is an empty string, the dialog will use "Create New 'Base Type'" as the default title.
  477. The ``type_blocklist`` contains a list of type names, and the types in the blocklist will be hidden from the create dialog.
  478. \ **Note:** Trying to list the base type in the ``type_blocklist`` will hide all types derived from the base type from the create dialog.
  479. .. rst-class:: classref-item-separator
  480. ----
  481. .. _class_EditorInterface_method_popup_dialog:
  482. .. rst-class:: classref-method
  483. |void| **popup_dialog**\ (\ dialog\: :ref:`Window<class_Window>`, rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_dialog>`
  484. Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive()<class_Window_method_popup_exclusive>`. The dialog must have no current parent, otherwise the method fails.
  485. See also :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`.
  486. .. rst-class:: classref-item-separator
  487. ----
  488. .. _class_EditorInterface_method_popup_dialog_centered:
  489. .. rst-class:: classref-method
  490. |void| **popup_dialog_centered**\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_dialog_centered>`
  491. Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered()<class_Window_method_popup_exclusive_centered>`. The dialog must have no current parent, otherwise the method fails.
  492. See also :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`.
  493. .. rst-class:: classref-item-separator
  494. ----
  495. .. _class_EditorInterface_method_popup_dialog_centered_clamped:
  496. .. rst-class:: classref-method
  497. |void| **popup_dialog_centered_clamped**\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0), fallback_ratio\: :ref:`float<class_float>` = 0.75\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_dialog_centered_clamped>`
  498. Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered_clamped()<class_Window_method_popup_exclusive_centered_clamped>`. The dialog must have no current parent, otherwise the method fails.
  499. See also :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`.
  500. .. rst-class:: classref-item-separator
  501. ----
  502. .. _class_EditorInterface_method_popup_dialog_centered_ratio:
  503. .. rst-class:: classref-method
  504. |void| **popup_dialog_centered_ratio**\ (\ dialog\: :ref:`Window<class_Window>`, ratio\: :ref:`float<class_float>` = 0.8\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_dialog_centered_ratio>`
  505. Pops up the ``dialog`` in the editor UI with :ref:`Window.popup_exclusive_centered_ratio()<class_Window_method_popup_exclusive_centered_ratio>`. The dialog must have no current parent, otherwise the method fails.
  506. See also :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_EditorInterface_method_popup_method_selector:
  510. .. rst-class:: classref-method
  511. |void| **popup_method_selector**\ (\ object\: :ref:`Object<class_Object>`, callback\: :ref:`Callable<class_Callable>`, current_value\: :ref:`String<class_String>` = ""\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_method_selector>`
  512. Pops up an editor dialog for selecting a method from ``object``. The ``callback`` must take a single argument of type :ref:`String<class_String>` which will contain the name of the selected method or be empty if the dialog is canceled. If ``current_value`` is provided, the method will be selected automatically in the method list, if it exists.
  513. .. rst-class:: classref-item-separator
  514. ----
  515. .. _class_EditorInterface_method_popup_node_selector:
  516. .. rst-class:: classref-method
  517. |void| **popup_node_selector**\ (\ callback\: :ref:`Callable<class_Callable>`, valid_types\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = [], current_value\: :ref:`Node<class_Node>` = null\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_node_selector>`
  518. Pops up an editor dialog for selecting a :ref:`Node<class_Node>` from the edited scene. The ``callback`` must take a single argument of type :ref:`NodePath<class_NodePath>`. It is called on the selected :ref:`NodePath<class_NodePath>` or the empty path ``^""`` if the dialog is canceled. If ``valid_types`` is provided, the dialog will only show Nodes that match one of the listed Node types. If ``current_value`` is provided, the Node will be automatically selected in the tree, if it exists.
  519. \ **Example:** Display the node selection dialog as soon as this node is added to the tree for the first time:
  520. ::
  521. func _ready():
  522. if Engine.is_editor_hint():
  523. EditorInterface.popup_node_selector(_on_node_selected, ["Button"])
  524. func _on_node_selected(node_path):
  525. if node_path.is_empty():
  526. print("node selection canceled")
  527. else:
  528. print("selected ", node_path)
  529. .. rst-class:: classref-item-separator
  530. ----
  531. .. _class_EditorInterface_method_popup_property_selector:
  532. .. rst-class:: classref-method
  533. |void| **popup_property_selector**\ (\ object\: :ref:`Object<class_Object>`, callback\: :ref:`Callable<class_Callable>`, type_filter\: :ref:`PackedInt32Array<class_PackedInt32Array>` = PackedInt32Array(), current_value\: :ref:`String<class_String>` = ""\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_property_selector>`
  534. Pops up an editor dialog for selecting properties from ``object``. The ``callback`` must take a single argument of type :ref:`NodePath<class_NodePath>`. It is called on the selected property path (see :ref:`NodePath.get_as_property_path()<class_NodePath_method_get_as_property_path>`) or the empty path ``^""`` if the dialog is canceled. If ``type_filter`` is provided, the dialog will only show properties that match one of the listed :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` values. If ``current_value`` is provided, the property will be selected automatically in the property list, if it exists.
  535. ::
  536. func _ready():
  537. if Engine.is_editor_hint():
  538. EditorInterface.popup_property_selector(this, _on_property_selected, [TYPE_INT])
  539. func _on_property_selected(property_path):
  540. if property_path.is_empty():
  541. print("property selection canceled")
  542. else:
  543. print("selected ", property_path)
  544. .. rst-class:: classref-item-separator
  545. ----
  546. .. _class_EditorInterface_method_popup_quick_open:
  547. .. rst-class:: classref-method
  548. |void| **popup_quick_open**\ (\ callback\: :ref:`Callable<class_Callable>`, base_types\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] = []\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_quick_open>`
  549. Pops up an editor dialog for quick selecting a resource file. The ``callback`` must take a single argument of type :ref:`String<class_String>` which will contain the path of the selected resource or be empty if the dialog is canceled. If ``base_types`` is provided, the dialog will only show resources that match these types. Only types deriving from :ref:`Resource<class_Resource>` are supported.
  550. .. rst-class:: classref-item-separator
  551. ----
  552. .. _class_EditorInterface_method_reload_scene_from_path:
  553. .. rst-class:: classref-method
  554. |void| **reload_scene_from_path**\ (\ scene_filepath\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_reload_scene_from_path>`
  555. Reloads the scene at the given path.
  556. .. rst-class:: classref-item-separator
  557. ----
  558. .. _class_EditorInterface_method_restart_editor:
  559. .. rst-class:: classref-method
  560. |void| **restart_editor**\ (\ save\: :ref:`bool<class_bool>` = true\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_restart_editor>`
  561. Restarts the editor. This closes the editor and then opens the same project. If ``save`` is ``true``, the project will be saved before restarting.
  562. .. rst-class:: classref-item-separator
  563. ----
  564. .. _class_EditorInterface_method_save_all_scenes:
  565. .. rst-class:: classref-method
  566. |void| **save_all_scenes**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_save_all_scenes>`
  567. Saves all opened scenes in the editor.
  568. .. rst-class:: classref-item-separator
  569. ----
  570. .. _class_EditorInterface_method_save_scene:
  571. .. rst-class:: classref-method
  572. :ref:`Error<enum_@GlobalScope_Error>` **save_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_save_scene>`
  573. Saves the currently active scene. Returns either :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` or :ref:`@GlobalScope.ERR_CANT_CREATE<class_@GlobalScope_constant_ERR_CANT_CREATE>`.
  574. .. rst-class:: classref-item-separator
  575. ----
  576. .. _class_EditorInterface_method_save_scene_as:
  577. .. rst-class:: classref-method
  578. |void| **save_scene_as**\ (\ path\: :ref:`String<class_String>`, with_preview\: :ref:`bool<class_bool>` = true\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_save_scene_as>`
  579. Saves the currently active scene as a file at ``path``.
  580. .. rst-class:: classref-item-separator
  581. ----
  582. .. _class_EditorInterface_method_select_file:
  583. .. rst-class:: classref-method
  584. |void| **select_file**\ (\ file\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_select_file>`
  585. Selects the file, with the path provided by ``file``, in the FileSystem dock.
  586. .. rst-class:: classref-item-separator
  587. ----
  588. .. _class_EditorInterface_method_set_current_feature_profile:
  589. .. rst-class:: classref-method
  590. |void| **set_current_feature_profile**\ (\ profile_name\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_set_current_feature_profile>`
  591. Selects and activates the specified feature profile with the given ``profile_name``. Set ``profile_name`` to an empty string to reset to the default feature profile.
  592. A feature profile can be created programmatically using the :ref:`EditorFeatureProfile<class_EditorFeatureProfile>` class.
  593. \ **Note:** The feature profile that gets activated must be located in the ``feature_profiles`` directory, as a file with the ``.profile`` extension. If a profile could not be found, an error occurs. The editor configuration folder can be found by using :ref:`EditorPaths.get_config_dir()<class_EditorPaths_method_get_config_dir>`.
  594. .. rst-class:: classref-item-separator
  595. ----
  596. .. _class_EditorInterface_method_set_main_screen_editor:
  597. .. rst-class:: classref-method
  598. |void| **set_main_screen_editor**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_set_main_screen_editor>`
  599. Sets the editor's current main screen to the one specified in ``name``. ``name`` must match the title of the tab in question exactly (e.g. ``2D``, ``3D``, ``Script``, ``Game``, or ``AssetLib`` for default tabs).
  600. .. rst-class:: classref-item-separator
  601. ----
  602. .. _class_EditorInterface_method_set_plugin_enabled:
  603. .. rst-class:: classref-method
  604. |void| **set_plugin_enabled**\ (\ plugin\: :ref:`String<class_String>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_set_plugin_enabled>`
  605. Sets the enabled status of a plugin. The plugin name is the same as its directory name.
  606. .. rst-class:: classref-item-separator
  607. ----
  608. .. _class_EditorInterface_method_stop_playing_scene:
  609. .. rst-class:: classref-method
  610. |void| **stop_playing_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_stop_playing_scene>`
  611. Stops the scene that is currently playing.
  612. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  613. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  614. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  615. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  616. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  617. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  618. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  619. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  620. .. |void| replace:: :abbr:`void (No return value.)`