class_editorinterface.rst 89 KB

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