class_editorinterface.rst 92 KB

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