class_editorinterface.rst 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  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. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`close_scene<class_EditorInterface_method_close_scene>`\ (\ ) |
  39. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | |void| | :ref:`edit_node<class_EditorInterface_method_edit_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
  41. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | |void| | :ref:`edit_resource<class_EditorInterface_method_edit_resource>`\ (\ resource\: :ref:`Resource<class_Resource>`\ ) |
  43. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | |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\ ) |
  45. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Control<class_Control>` | :ref:`get_base_control<class_EditorInterface_method_get_base_control>`\ (\ ) |const| |
  47. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`EditorCommandPalette<class_EditorCommandPalette>` | :ref:`get_command_palette<class_EditorInterface_method_get_command_palette>`\ (\ ) |const| |
  49. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`String<class_String>` | :ref:`get_current_directory<class_EditorInterface_method_get_current_directory>`\ (\ ) |const| |
  51. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`String<class_String>` | :ref:`get_current_feature_profile<class_EditorInterface_method_get_current_feature_profile>`\ (\ ) |const| |
  53. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`String<class_String>` | :ref:`get_current_path<class_EditorInterface_method_get_current_path>`\ (\ ) |const| |
  55. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Node<class_Node>` | :ref:`get_edited_scene_root<class_EditorInterface_method_get_edited_scene_root>`\ (\ ) |const| |
  57. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`VBoxContainer<class_VBoxContainer>` | :ref:`get_editor_main_screen<class_EditorInterface_method_get_editor_main_screen>`\ (\ ) |const| |
  59. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`EditorPaths<class_EditorPaths>` | :ref:`get_editor_paths<class_EditorInterface_method_get_editor_paths>`\ (\ ) |const| |
  61. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`float<class_float>` | :ref:`get_editor_scale<class_EditorInterface_method_get_editor_scale>`\ (\ ) |const| |
  63. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`EditorSettings<class_EditorSettings>` | :ref:`get_editor_settings<class_EditorInterface_method_get_editor_settings>`\ (\ ) |const| |
  65. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Theme<class_Theme>` | :ref:`get_editor_theme<class_EditorInterface_method_get_editor_theme>`\ (\ ) |const| |
  67. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`EditorToaster<class_EditorToaster>` | :ref:`get_editor_toaster<class_EditorInterface_method_get_editor_toaster>`\ (\ ) |const| |
  69. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>` | :ref:`get_editor_undo_redo<class_EditorInterface_method_get_editor_undo_redo>`\ (\ ) |const| |
  71. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`SubViewport<class_SubViewport>` | :ref:`get_editor_viewport_2d<class_EditorInterface_method_get_editor_viewport_2d>`\ (\ ) |const| |
  73. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`SubViewport<class_SubViewport>` | :ref:`get_editor_viewport_3d<class_EditorInterface_method_get_editor_viewport_3d>`\ (\ idx\: :ref:`int<class_int>` = 0\ ) |const| |
  75. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`FileSystemDock<class_FileSystemDock>` | :ref:`get_file_system_dock<class_EditorInterface_method_get_file_system_dock>`\ (\ ) |const| |
  77. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`EditorInspector<class_EditorInspector>` | :ref:`get_inspector<class_EditorInterface_method_get_inspector>`\ (\ ) |const| |
  79. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_open_scene_roots<class_EditorInterface_method_get_open_scene_roots>`\ (\ ) |const| |
  81. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_open_scenes<class_EditorInterface_method_get_open_scenes>`\ (\ ) |const| |
  83. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`String<class_String>` | :ref:`get_playing_scene<class_EditorInterface_method_get_playing_scene>`\ (\ ) |const| |
  85. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`EditorFileSystem<class_EditorFileSystem>` | :ref:`get_resource_filesystem<class_EditorInterface_method_get_resource_filesystem>`\ (\ ) |const| |
  87. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`EditorResourcePreview<class_EditorResourcePreview>` | :ref:`get_resource_previewer<class_EditorInterface_method_get_resource_previewer>`\ (\ ) |const| |
  89. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`ScriptEditor<class_ScriptEditor>` | :ref:`get_script_editor<class_EditorInterface_method_get_script_editor>`\ (\ ) |const| |
  91. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_selected_paths<class_EditorInterface_method_get_selected_paths>`\ (\ ) |const| |
  93. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`EditorSelection<class_EditorSelection>` | :ref:`get_selection<class_EditorInterface_method_get_selection>`\ (\ ) |const| |
  95. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | |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\ ) |
  97. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`is_multi_window_enabled<class_EditorInterface_method_is_multi_window_enabled>`\ (\ ) |const| |
  99. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`bool<class_bool>` | :ref:`is_playing_scene<class_EditorInterface_method_is_playing_scene>`\ (\ ) |const| |
  101. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`is_plugin_enabled<class_EditorInterface_method_is_plugin_enabled>`\ (\ plugin\: :ref:`String<class_String>`\ ) |const| |
  103. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :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>`\ ) |
  105. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | |void| | :ref:`mark_scene_as_unsaved<class_EditorInterface_method_mark_scene_as_unsaved>`\ (\ ) |
  107. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | |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\ ) |
  109. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | |void| | :ref:`play_current_scene<class_EditorInterface_method_play_current_scene>`\ (\ ) |
  111. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | |void| | :ref:`play_custom_scene<class_EditorInterface_method_play_custom_scene>`\ (\ scene_filepath\: :ref:`String<class_String>`\ ) |
  113. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | |void| | :ref:`play_main_scene<class_EditorInterface_method_play_main_scene>`\ (\ ) |
  115. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | |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>`\] = []\ ) |
  117. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | |void| | :ref:`popup_dialog<class_EditorInterface_method_popup_dialog>`\ (\ dialog\: :ref:`Window<class_Window>`, rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) |
  119. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | |void| | :ref:`popup_dialog_centered<class_EditorInterface_method_popup_dialog_centered>`\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) |
  121. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | |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\ ) |
  123. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | |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\ ) |
  125. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | |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>` = ""\ ) |
  127. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | |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\ ) |
  129. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | |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>` = ""\ ) |
  131. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | |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>`\] = []\ ) |
  133. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`reload_scene_from_path<class_EditorInterface_method_reload_scene_from_path>`\ (\ scene_filepath\: :ref:`String<class_String>`\ ) |
  135. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | |void| | :ref:`restart_editor<class_EditorInterface_method_restart_editor>`\ (\ save\: :ref:`bool<class_bool>` = true\ ) |
  137. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | |void| | :ref:`save_all_scenes<class_EditorInterface_method_save_all_scenes>`\ (\ ) |
  139. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_scene<class_EditorInterface_method_save_scene>`\ (\ ) |
  141. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`save_scene_as<class_EditorInterface_method_save_scene_as>`\ (\ path\: :ref:`String<class_String>`, with_preview\: :ref:`bool<class_bool>` = true\ ) |
  143. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | |void| | :ref:`select_file<class_EditorInterface_method_select_file>`\ (\ file\: :ref:`String<class_String>`\ ) |
  145. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | |void| | :ref:`set_current_feature_profile<class_EditorInterface_method_set_current_feature_profile>`\ (\ profile_name\: :ref:`String<class_String>`\ ) |
  147. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | |void| | :ref:`set_main_screen_editor<class_EditorInterface_method_set_main_screen_editor>`\ (\ name\: :ref:`String<class_String>`\ ) |
  149. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | |void| | :ref:`set_plugin_enabled<class_EditorInterface_method_set_plugin_enabled>`\ (\ plugin\: :ref:`String<class_String>`, enabled\: :ref:`bool<class_bool>`\ ) |
  151. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | |void| | :ref:`stop_playing_scene<class_EditorInterface_method_stop_playing_scene>`\ (\ ) |
  153. +----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. .. rst-class:: classref-section-separator
  155. ----
  156. .. rst-class:: classref-descriptions-group
  157. Property Descriptions
  158. ---------------------
  159. .. _class_EditorInterface_property_distraction_free_mode:
  160. .. rst-class:: classref-property
  161. :ref:`bool<class_bool>` **distraction_free_mode** :ref:`๐Ÿ”—<class_EditorInterface_property_distraction_free_mode>`
  162. .. rst-class:: classref-property-setget
  163. - |void| **set_distraction_free_mode**\ (\ value\: :ref:`bool<class_bool>`\ )
  164. - :ref:`bool<class_bool>` **is_distraction_free_mode_enabled**\ (\ )
  165. If ``true``, enables distraction-free mode which hides side docks to increase the space available for the main view.
  166. .. rst-class:: classref-item-separator
  167. ----
  168. .. _class_EditorInterface_property_movie_maker_enabled:
  169. .. rst-class:: classref-property
  170. :ref:`bool<class_bool>` **movie_maker_enabled** :ref:`๐Ÿ”—<class_EditorInterface_property_movie_maker_enabled>`
  171. .. rst-class:: classref-property-setget
  172. - |void| **set_movie_maker_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  173. - :ref:`bool<class_bool>` **is_movie_maker_enabled**\ (\ )
  174. If ``true``, the Movie Maker mode is enabled in the editor. See :ref:`MovieWriter<class_MovieWriter>` for more information.
  175. .. rst-class:: classref-section-separator
  176. ----
  177. .. rst-class:: classref-descriptions-group
  178. Method Descriptions
  179. -------------------
  180. .. _class_EditorInterface_method_close_scene:
  181. .. rst-class:: classref-method
  182. :ref:`Error<enum_@GlobalScope_Error>` **close_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_close_scene>`
  183. 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.
  184. .. rst-class:: classref-item-separator
  185. ----
  186. .. _class_EditorInterface_method_edit_node:
  187. .. rst-class:: classref-method
  188. |void| **edit_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_edit_node>`
  189. Edits the given :ref:`Node<class_Node>`. The node will be also selected if it's inside the scene tree.
  190. .. rst-class:: classref-item-separator
  191. ----
  192. .. _class_EditorInterface_method_edit_resource:
  193. .. rst-class:: classref-method
  194. |void| **edit_resource**\ (\ resource\: :ref:`Resource<class_Resource>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_edit_resource>`
  195. 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.
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_EditorInterface_method_edit_script:
  199. .. rst-class:: classref-method
  200. |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>`
  201. 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.
  202. .. rst-class:: classref-item-separator
  203. ----
  204. .. _class_EditorInterface_method_get_base_control:
  205. .. rst-class:: classref-method
  206. :ref:`Control<class_Control>` **get_base_control**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_base_control>`
  207. 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.
  208. \ **Warning:** Removing and freeing this node will render the editor useless and may cause a crash.
  209. .. rst-class:: classref-item-separator
  210. ----
  211. .. _class_EditorInterface_method_get_command_palette:
  212. .. rst-class:: classref-method
  213. :ref:`EditorCommandPalette<class_EditorCommandPalette>` **get_command_palette**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_command_palette>`
  214. Returns the editor's :ref:`EditorCommandPalette<class_EditorCommandPalette>` instance.
  215. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  216. .. rst-class:: classref-item-separator
  217. ----
  218. .. _class_EditorInterface_method_get_current_directory:
  219. .. rst-class:: classref-method
  220. :ref:`String<class_String>` **get_current_directory**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_current_directory>`
  221. 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.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_EditorInterface_method_get_current_feature_profile:
  225. .. rst-class:: classref-method
  226. :ref:`String<class_String>` **get_current_feature_profile**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_current_feature_profile>`
  227. Returns the name of the currently activated feature profile. If the default profile is currently active, an empty string is returned instead.
  228. 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>`.
  229. \ **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>`.
  230. .. rst-class:: classref-item-separator
  231. ----
  232. .. _class_EditorInterface_method_get_current_path:
  233. .. rst-class:: classref-method
  234. :ref:`String<class_String>` **get_current_path**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_current_path>`
  235. Returns the current path being viewed in the :ref:`FileSystemDock<class_FileSystemDock>`.
  236. .. rst-class:: classref-item-separator
  237. ----
  238. .. _class_EditorInterface_method_get_edited_scene_root:
  239. .. rst-class:: classref-method
  240. :ref:`Node<class_Node>` **get_edited_scene_root**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_edited_scene_root>`
  241. Returns the edited (current) scene's root :ref:`Node<class_Node>`.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _class_EditorInterface_method_get_editor_main_screen:
  245. .. rst-class:: classref-method
  246. :ref:`VBoxContainer<class_VBoxContainer>` **get_editor_main_screen**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_main_screen>`
  247. 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>`.
  248. \ **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.
  249. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  250. .. rst-class:: classref-item-separator
  251. ----
  252. .. _class_EditorInterface_method_get_editor_paths:
  253. .. rst-class:: classref-method
  254. :ref:`EditorPaths<class_EditorPaths>` **get_editor_paths**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_paths>`
  255. Returns the :ref:`EditorPaths<class_EditorPaths>` singleton.
  256. .. rst-class:: classref-item-separator
  257. ----
  258. .. _class_EditorInterface_method_get_editor_scale:
  259. .. rst-class:: classref-method
  260. :ref:`float<class_float>` **get_editor_scale**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_scale>`
  261. 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.
  262. \ **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.
  263. .. rst-class:: classref-item-separator
  264. ----
  265. .. _class_EditorInterface_method_get_editor_settings:
  266. .. rst-class:: classref-method
  267. :ref:`EditorSettings<class_EditorSettings>` **get_editor_settings**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_settings>`
  268. Returns the editor's :ref:`EditorSettings<class_EditorSettings>` instance.
  269. .. rst-class:: classref-item-separator
  270. ----
  271. .. _class_EditorInterface_method_get_editor_theme:
  272. .. rst-class:: classref-method
  273. :ref:`Theme<class_Theme>` **get_editor_theme**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_theme>`
  274. Returns the editor's :ref:`Theme<class_Theme>`.
  275. \ **Note:** When creating custom editor UI, prefer accessing theme items directly from your GUI nodes using the ``get_theme_*`` methods.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_EditorInterface_method_get_editor_toaster:
  279. .. rst-class:: classref-method
  280. :ref:`EditorToaster<class_EditorToaster>` **get_editor_toaster**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_toaster>`
  281. Returns the editor's :ref:`EditorToaster<class_EditorToaster>`.
  282. .. rst-class:: classref-item-separator
  283. ----
  284. .. _class_EditorInterface_method_get_editor_undo_redo:
  285. .. rst-class:: classref-method
  286. :ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>` **get_editor_undo_redo**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_undo_redo>`
  287. Returns the editor's :ref:`EditorUndoRedoManager<class_EditorUndoRedoManager>`.
  288. .. rst-class:: classref-item-separator
  289. ----
  290. .. _class_EditorInterface_method_get_editor_viewport_2d:
  291. .. rst-class:: classref-method
  292. :ref:`SubViewport<class_SubViewport>` **get_editor_viewport_2d**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_viewport_2d>`
  293. 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>`.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_EditorInterface_method_get_editor_viewport_3d:
  297. .. rst-class:: classref-method
  298. :ref:`SubViewport<class_SubViewport>` **get_editor_viewport_3d**\ (\ idx\: :ref:`int<class_int>` = 0\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_editor_viewport_3d>`
  299. 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>`.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_EditorInterface_method_get_file_system_dock:
  303. .. rst-class:: classref-method
  304. :ref:`FileSystemDock<class_FileSystemDock>` **get_file_system_dock**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_file_system_dock>`
  305. Returns the editor's :ref:`FileSystemDock<class_FileSystemDock>` instance.
  306. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  307. .. rst-class:: classref-item-separator
  308. ----
  309. .. _class_EditorInterface_method_get_inspector:
  310. .. rst-class:: classref-method
  311. :ref:`EditorInspector<class_EditorInspector>` **get_inspector**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_inspector>`
  312. Returns the editor's :ref:`EditorInspector<class_EditorInspector>` instance.
  313. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_EditorInterface_method_get_open_scene_roots:
  317. .. rst-class:: classref-method
  318. :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_open_scene_roots**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_open_scene_roots>`
  319. Returns an array with references to the root nodes of the currently opened scenes.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_EditorInterface_method_get_open_scenes:
  323. .. rst-class:: classref-method
  324. :ref:`PackedStringArray<class_PackedStringArray>` **get_open_scenes**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_open_scenes>`
  325. Returns an array with the file paths of the currently opened scenes.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_EditorInterface_method_get_playing_scene:
  329. .. rst-class:: classref-method
  330. :ref:`String<class_String>` **get_playing_scene**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_playing_scene>`
  331. Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_EditorInterface_method_get_resource_filesystem:
  335. .. rst-class:: classref-method
  336. :ref:`EditorFileSystem<class_EditorFileSystem>` **get_resource_filesystem**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_resource_filesystem>`
  337. Returns the editor's :ref:`EditorFileSystem<class_EditorFileSystem>` instance.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_EditorInterface_method_get_resource_previewer:
  341. .. rst-class:: classref-method
  342. :ref:`EditorResourcePreview<class_EditorResourcePreview>` **get_resource_previewer**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_resource_previewer>`
  343. Returns the editor's :ref:`EditorResourcePreview<class_EditorResourcePreview>` instance.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_EditorInterface_method_get_script_editor:
  347. .. rst-class:: classref-method
  348. :ref:`ScriptEditor<class_ScriptEditor>` **get_script_editor**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_script_editor>`
  349. Returns the editor's :ref:`ScriptEditor<class_ScriptEditor>` instance.
  350. \ **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash.
  351. .. rst-class:: classref-item-separator
  352. ----
  353. .. _class_EditorInterface_method_get_selected_paths:
  354. .. rst-class:: classref-method
  355. :ref:`PackedStringArray<class_PackedStringArray>` **get_selected_paths**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_selected_paths>`
  356. Returns an array containing the paths of the currently selected files (and directories) in the :ref:`FileSystemDock<class_FileSystemDock>`.
  357. .. rst-class:: classref-item-separator
  358. ----
  359. .. _class_EditorInterface_method_get_selection:
  360. .. rst-class:: classref-method
  361. :ref:`EditorSelection<class_EditorSelection>` **get_selection**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_get_selection>`
  362. Returns the editor's :ref:`EditorSelection<class_EditorSelection>` instance.
  363. .. rst-class:: classref-item-separator
  364. ----
  365. .. _class_EditorInterface_method_inspect_object:
  366. .. rst-class:: classref-method
  367. |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>`
  368. 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``.
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _class_EditorInterface_method_is_multi_window_enabled:
  372. .. rst-class:: classref-method
  373. :ref:`bool<class_bool>` **is_multi_window_enabled**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_is_multi_window_enabled>`
  374. Returns ``true`` if multiple window support is enabled in the editor. Multiple window support is enabled if *all* of these statements are true:
  375. - :ref:`EditorSettings.interface/multi_window/enable<class_EditorSettings_property_interface/multi_window/enable>` is ``true``.
  376. - :ref:`EditorSettings.interface/editor/single_window_mode<class_EditorSettings_property_interface/editor/single_window_mode>` is ``false``.
  377. - :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.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_EditorInterface_method_is_playing_scene:
  381. .. rst-class:: classref-method
  382. :ref:`bool<class_bool>` **is_playing_scene**\ (\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_is_playing_scene>`
  383. Returns ``true`` if a scene is currently being played, ``false`` otherwise. Paused scenes are considered as being played.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_EditorInterface_method_is_plugin_enabled:
  387. .. rst-class:: classref-method
  388. :ref:`bool<class_bool>` **is_plugin_enabled**\ (\ plugin\: :ref:`String<class_String>`\ ) |const| :ref:`๐Ÿ”—<class_EditorInterface_method_is_plugin_enabled>`
  389. Returns ``true`` if the specified ``plugin`` is enabled. The plugin name is the same as its directory name.
  390. .. rst-class:: classref-item-separator
  391. ----
  392. .. _class_EditorInterface_method_make_mesh_previews:
  393. .. rst-class:: classref-method
  394. :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>`
  395. Returns mesh previews rendered at the given size as an :ref:`Array<class_Array>` of :ref:`Texture2D<class_Texture2D>`\ s.
  396. .. rst-class:: classref-item-separator
  397. ----
  398. .. _class_EditorInterface_method_mark_scene_as_unsaved:
  399. .. rst-class:: classref-method
  400. |void| **mark_scene_as_unsaved**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_mark_scene_as_unsaved>`
  401. Marks the current scene tab as unsaved.
  402. .. rst-class:: classref-item-separator
  403. ----
  404. .. _class_EditorInterface_method_open_scene_from_path:
  405. .. rst-class:: classref-method
  406. |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>`
  407. Opens the scene at the given path. If ``set_inherited`` is ``true``, creates a new inherited scene.
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_EditorInterface_method_play_current_scene:
  411. .. rst-class:: classref-method
  412. |void| **play_current_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_play_current_scene>`
  413. Plays the currently active scene.
  414. .. rst-class:: classref-item-separator
  415. ----
  416. .. _class_EditorInterface_method_play_custom_scene:
  417. .. rst-class:: classref-method
  418. |void| **play_custom_scene**\ (\ scene_filepath\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_play_custom_scene>`
  419. Plays the scene specified by its filepath.
  420. .. rst-class:: classref-item-separator
  421. ----
  422. .. _class_EditorInterface_method_play_main_scene:
  423. .. rst-class:: classref-method
  424. |void| **play_main_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_play_main_scene>`
  425. Plays the main scene.
  426. .. rst-class:: classref-item-separator
  427. ----
  428. .. _class_EditorInterface_method_popup_create_dialog:
  429. .. rst-class:: classref-method
  430. |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>`
  431. **Experimental:** This method may be changed or removed in future versions.
  432. Pops up an editor dialog for creating an object.
  433. 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.
  434. 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.
  435. 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.
  436. 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.
  437. The ``type_blocklist`` contains a list of type names, and the types in the blocklist will be hidden from the create dialog.
  438. \ **Note:** Trying to list the base type in the ``type_blocklist`` will hide all types derived from the base type from the create dialog.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _class_EditorInterface_method_popup_dialog:
  442. .. rst-class:: classref-method
  443. |void| **popup_dialog**\ (\ dialog\: :ref:`Window<class_Window>`, rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_dialog>`
  444. 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.
  445. See also :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`.
  446. .. rst-class:: classref-item-separator
  447. ----
  448. .. _class_EditorInterface_method_popup_dialog_centered:
  449. .. rst-class:: classref-method
  450. |void| **popup_dialog_centered**\ (\ dialog\: :ref:`Window<class_Window>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_popup_dialog_centered>`
  451. 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.
  452. See also :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`.
  453. .. rst-class:: classref-item-separator
  454. ----
  455. .. _class_EditorInterface_method_popup_dialog_centered_clamped:
  456. .. rst-class:: classref-method
  457. |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>`
  458. 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.
  459. See also :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`.
  460. .. rst-class:: classref-item-separator
  461. ----
  462. .. _class_EditorInterface_method_popup_dialog_centered_ratio:
  463. .. rst-class:: classref-method
  464. |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>`
  465. 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.
  466. See also :ref:`Window.set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>`.
  467. .. rst-class:: classref-item-separator
  468. ----
  469. .. _class_EditorInterface_method_popup_method_selector:
  470. .. rst-class:: classref-method
  471. |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>`
  472. 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.
  473. .. rst-class:: classref-item-separator
  474. ----
  475. .. _class_EditorInterface_method_popup_node_selector:
  476. .. rst-class:: classref-method
  477. |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>`
  478. 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.
  479. \ **Example:** Display the node selection dialog as soon as this node is added to the tree for the first time:
  480. ::
  481. func _ready():
  482. if Engine.is_editor_hint():
  483. EditorInterface.popup_node_selector(_on_node_selected, ["Button"])
  484. func _on_node_selected(node_path):
  485. if node_path.is_empty():
  486. print("node selection canceled")
  487. else:
  488. print("selected ", node_path)
  489. .. rst-class:: classref-item-separator
  490. ----
  491. .. _class_EditorInterface_method_popup_property_selector:
  492. .. rst-class:: classref-method
  493. |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>`
  494. 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.
  495. ::
  496. func _ready():
  497. if Engine.is_editor_hint():
  498. EditorInterface.popup_property_selector(this, _on_property_selected, [TYPE_INT])
  499. func _on_property_selected(property_path):
  500. if property_path.is_empty():
  501. print("property selection canceled")
  502. else:
  503. print("selected ", property_path)
  504. .. rst-class:: classref-item-separator
  505. ----
  506. .. _class_EditorInterface_method_popup_quick_open:
  507. .. rst-class:: classref-method
  508. |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>`
  509. 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.
  510. .. rst-class:: classref-item-separator
  511. ----
  512. .. _class_EditorInterface_method_reload_scene_from_path:
  513. .. rst-class:: classref-method
  514. |void| **reload_scene_from_path**\ (\ scene_filepath\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_reload_scene_from_path>`
  515. Reloads the scene at the given path.
  516. .. rst-class:: classref-item-separator
  517. ----
  518. .. _class_EditorInterface_method_restart_editor:
  519. .. rst-class:: classref-method
  520. |void| **restart_editor**\ (\ save\: :ref:`bool<class_bool>` = true\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_restart_editor>`
  521. Restarts the editor. This closes the editor and then opens the same project. If ``save`` is ``true``, the project will be saved before restarting.
  522. .. rst-class:: classref-item-separator
  523. ----
  524. .. _class_EditorInterface_method_save_all_scenes:
  525. .. rst-class:: classref-method
  526. |void| **save_all_scenes**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_save_all_scenes>`
  527. Saves all opened scenes in the editor.
  528. .. rst-class:: classref-item-separator
  529. ----
  530. .. _class_EditorInterface_method_save_scene:
  531. .. rst-class:: classref-method
  532. :ref:`Error<enum_@GlobalScope_Error>` **save_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_save_scene>`
  533. 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>`.
  534. .. rst-class:: classref-item-separator
  535. ----
  536. .. _class_EditorInterface_method_save_scene_as:
  537. .. rst-class:: classref-method
  538. |void| **save_scene_as**\ (\ path\: :ref:`String<class_String>`, with_preview\: :ref:`bool<class_bool>` = true\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_save_scene_as>`
  539. Saves the currently active scene as a file at ``path``.
  540. .. rst-class:: classref-item-separator
  541. ----
  542. .. _class_EditorInterface_method_select_file:
  543. .. rst-class:: classref-method
  544. |void| **select_file**\ (\ file\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_select_file>`
  545. Selects the file, with the path provided by ``file``, in the FileSystem dock.
  546. .. rst-class:: classref-item-separator
  547. ----
  548. .. _class_EditorInterface_method_set_current_feature_profile:
  549. .. rst-class:: classref-method
  550. |void| **set_current_feature_profile**\ (\ profile_name\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_set_current_feature_profile>`
  551. 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.
  552. A feature profile can be created programmatically using the :ref:`EditorFeatureProfile<class_EditorFeatureProfile>` class.
  553. \ **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>`.
  554. .. rst-class:: classref-item-separator
  555. ----
  556. .. _class_EditorInterface_method_set_main_screen_editor:
  557. .. rst-class:: classref-method
  558. |void| **set_main_screen_editor**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_set_main_screen_editor>`
  559. 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).
  560. .. rst-class:: classref-item-separator
  561. ----
  562. .. _class_EditorInterface_method_set_plugin_enabled:
  563. .. rst-class:: classref-method
  564. |void| **set_plugin_enabled**\ (\ plugin\: :ref:`String<class_String>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_set_plugin_enabled>`
  565. Sets the enabled status of a plugin. The plugin name is the same as its directory name.
  566. .. rst-class:: classref-item-separator
  567. ----
  568. .. _class_EditorInterface_method_stop_playing_scene:
  569. .. rst-class:: classref-method
  570. |void| **stop_playing_scene**\ (\ ) :ref:`๐Ÿ”—<class_EditorInterface_method_stop_playing_scene>`
  571. Stops the scene that is currently playing.
  572. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  573. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  574. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  575. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  576. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  577. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  578. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  579. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  580. .. |void| replace:: :abbr:`void (No return value.)`