| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /*  editor_plugin.cpp                                                     */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /*                         This file is part of:                          */ | 
					
						
							|  |  |  | /*                             GODOT ENGINE                               */ | 
					
						
							|  |  |  | /*                        https://godotengine.org                         */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ | 
					
						
							|  |  |  | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* Permission is hereby granted, free of charge, to any person obtaining  */ | 
					
						
							|  |  |  | /* a copy of this software and associated documentation files (the        */ | 
					
						
							|  |  |  | /* "Software"), to deal in the Software without restriction, including    */ | 
					
						
							|  |  |  | /* without limitation the rights to use, copy, modify, merge, publish,    */ | 
					
						
							|  |  |  | /* distribute, sublicense, and/or sell copies of the Software, and to     */ | 
					
						
							|  |  |  | /* permit persons to whom the Software is furnished to do so, subject to  */ | 
					
						
							|  |  |  | /* the following conditions:                                              */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* The above copyright notice and this permission notice shall be         */ | 
					
						
							|  |  |  | /* included in all copies or substantial portions of the Software.        */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */ | 
					
						
							|  |  |  | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */ | 
					
						
							|  |  |  | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ | 
					
						
							|  |  |  | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */ | 
					
						
							|  |  |  | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */ | 
					
						
							|  |  |  | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */ | 
					
						
							|  |  |  | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							| 
									
										
										
										
											2018-01-05 00:50:27 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | #include "editor_plugin.h"
 | 
					
						
							| 
									
										
										
										
											2024-02-08 00:08:07 +01:00
										 |  |  | #include "editor_plugin.compat.inc"
 | 
					
						
							| 
									
										
										
										
											2017-01-16 08:04:19 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-11 20:12:48 +01:00
										 |  |  | #include "editor/debugger/editor_debugger_node.h"
 | 
					
						
							| 
									
										
										
										
											2023-10-27 15:55:07 -04:00
										 |  |  | #include "editor/editor_dock_manager.h"
 | 
					
						
							| 
									
										
										
										
											2023-04-05 17:14:46 +02:00
										 |  |  | #include "editor/editor_file_system.h"
 | 
					
						
							|  |  |  | #include "editor/editor_inspector.h"
 | 
					
						
							|  |  |  | #include "editor/editor_interface.h"
 | 
					
						
							| 
									
										
										
										
											2017-03-05 14:21:25 +01:00
										 |  |  | #include "editor/editor_node.h"
 | 
					
						
							| 
									
										
										
										
											2022-11-11 20:12:48 +01:00
										 |  |  | #include "editor/editor_translation_parser.h"
 | 
					
						
							| 
									
										
										
										
											2022-03-25 18:06:46 +01:00
										 |  |  | #include "editor/editor_undo_redo_manager.h"
 | 
					
						
							| 
									
										
										
										
											2022-07-17 12:24:37 -05:00
										 |  |  | #include "editor/export/editor_export.h"
 | 
					
						
							| 
									
										
										
										
											2024-04-17 10:44:44 +03:00
										 |  |  | #include "editor/export/editor_export_platform.h"
 | 
					
						
							| 
									
										
										
										
											2024-01-30 17:22:22 -05:00
										 |  |  | #include "editor/gui/editor_bottom_panel.h"
 | 
					
						
							| 
									
										
										
										
											2023-04-07 18:59:49 +02:00
										 |  |  | #include "editor/gui/editor_title_bar.h"
 | 
					
						
							| 
									
										
										
										
											2021-10-09 01:12:51 -05:00
										 |  |  | #include "editor/import/3d/resource_importer_scene.h"
 | 
					
						
							| 
									
										
										
										
											2022-11-11 20:12:48 +01:00
										 |  |  | #include "editor/import/editor_import_plugin.h"
 | 
					
						
							| 
									
										
										
										
											2022-11-19 12:45:49 +01:00
										 |  |  | #include "editor/inspector_dock.h"
 | 
					
						
							| 
									
										
										
										
											2022-02-14 14:00:03 +01:00
										 |  |  | #include "editor/plugins/canvas_item_editor_plugin.h"
 | 
					
						
							| 
									
										
										
										
											2022-10-03 15:21:25 +02:00
										 |  |  | #include "editor/plugins/editor_debugger_plugin.h"
 | 
					
						
							| 
									
										
										
										
											2023-01-14 13:02:34 -07:00
										 |  |  | #include "editor/plugins/editor_resource_conversion_plugin.h"
 | 
					
						
							| 
									
										
										
										
											2022-02-14 14:00:03 +01:00
										 |  |  | #include "editor/plugins/node_3d_editor_plugin.h"
 | 
					
						
							|  |  |  | #include "editor/plugins/script_editor_plugin.h"
 | 
					
						
							| 
									
										
										
										
											2019-12-24 15:17:23 +08:00
										 |  |  | #include "editor/project_settings_editor.h"
 | 
					
						
							| 
									
										
										
										
											2022-02-12 02:46:22 +01:00
										 |  |  | #include "editor/scene_tree_dock.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | #include "scene/3d/camera_3d.h"
 | 
					
						
							| 
									
										
										
										
											2016-08-07 11:01:22 -03:00
										 |  |  | #include "scene/gui/popup_menu.h"
 | 
					
						
							| 
									
										
										
										
											2018-09-26 17:38:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-11 15:43:37 -03:00
										 |  |  | void EditorPlugin::add_custom_type(const String &p_type, const String &p_base, const Ref<Script> &p_script, const Ref<Texture2D> &p_icon) { | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	EditorNode::get_editor_data().add_custom_type(p_type, p_base, p_script, p_icon); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_custom_type(const String &p_type) { | 
					
						
							|  |  |  | 	EditorNode::get_editor_data().remove_custom_type(p_type); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-13 22:31:38 -06:00
										 |  |  | void EditorPlugin::add_autoload_singleton(const String &p_name, const String &p_path) { | 
					
						
							| 
									
										
										
										
											2023-06-12 21:27:46 +09:00
										 |  |  | 	if (p_path.begins_with("res://")) { | 
					
						
							|  |  |  | 		EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_add(p_name, p_path); | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		const Ref<Script> plugin_script = static_cast<Ref<Script>>(get_script()); | 
					
						
							|  |  |  | 		ERR_FAIL_COND(plugin_script.is_null()); | 
					
						
							|  |  |  | 		const String script_base_path = plugin_script->get_path().get_base_dir(); | 
					
						
							|  |  |  | 		EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_add(p_name, script_base_path.path_join(p_path)); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-02-13 22:31:38 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_autoload_singleton(const String &p_name) { | 
					
						
							|  |  |  | 	EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_remove(p_name); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-08 00:08:07 +01:00
										 |  |  | Button *EditorPlugin::add_control_to_bottom_panel(Control *p_control, const String &p_title, const Ref<Shortcut> &p_shortcut) { | 
					
						
							| 
									
										
										
										
											2020-04-02 01:20:12 +02:00
										 |  |  | 	ERR_FAIL_NULL_V(p_control, nullptr); | 
					
						
							| 
									
										
										
										
											2024-02-08 00:08:07 +01:00
										 |  |  | 	return EditorNode::get_bottom_panel()->add_item(p_title, p_control, p_shortcut); | 
					
						
							| 
									
										
										
										
											2016-02-27 00:32:00 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-08 00:08:07 +01:00
										 |  |  | void EditorPlugin::add_control_to_dock(DockSlot p_slot, Control *p_control, const Ref<Shortcut> &p_shortcut) { | 
					
						
							| 
									
										
										
										
											2016-02-27 23:10:44 -03:00
										 |  |  | 	ERR_FAIL_NULL(p_control); | 
					
						
							| 
									
										
										
										
											2023-10-28 10:13:12 -04:00
										 |  |  | 	EditorDockManager::get_singleton()->add_dock(p_control, String(), EditorDockManager::DockSlot(p_slot), p_shortcut); | 
					
						
							| 
									
										
										
										
											2016-02-27 23:10:44 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_control_from_docks(Control *p_control) { | 
					
						
							|  |  |  | 	ERR_FAIL_NULL(p_control); | 
					
						
							| 
									
										
										
										
											2023-10-28 10:13:12 -04:00
										 |  |  | 	EditorDockManager::get_singleton()->remove_dock(p_control); | 
					
						
							| 
									
										
										
										
											2016-02-27 23:10:44 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2016-02-27 00:32:00 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-28 19:58:17 +00:00
										 |  |  | void EditorPlugin::remove_control_from_bottom_panel(Control *p_control) { | 
					
						
							|  |  |  | 	ERR_FAIL_NULL(p_control); | 
					
						
							| 
									
										
										
										
											2024-01-30 17:22:22 -05:00
										 |  |  | 	EditorNode::get_bottom_panel()->remove_item(p_control); | 
					
						
							| 
									
										
										
										
											2016-02-28 19:58:17 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-20 12:43:19 +08:00
										 |  |  | void EditorPlugin::set_dock_tab_icon(Control *p_control, const Ref<Texture2D> &p_icon) { | 
					
						
							|  |  |  | 	ERR_FAIL_NULL(p_control); | 
					
						
							|  |  |  | 	EditorDockManager::get_singleton()->set_dock_tab_icon(p_control, p_icon); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-27 00:32:00 -03:00
										 |  |  | void EditorPlugin::add_control_to_container(CustomControlContainer p_location, Control *p_control) { | 
					
						
							| 
									
										
										
										
											2018-06-27 18:06:39 -05:00
										 |  |  | 	ERR_FAIL_NULL(p_control); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	switch (p_location) { | 
					
						
							|  |  |  | 		case CONTAINER_TOOLBAR: { | 
					
						
							| 
									
										
										
										
											2023-04-12 21:02:28 +02:00
										 |  |  | 			EditorNode::get_title_bar()->add_child(p_control); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2016-02-27 00:32:00 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 		case CONTAINER_SPATIAL_EDITOR_MENU: { | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | 			Node3DEditor::get_singleton()->add_control_to_menu_panel(p_control); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2018-08-21 01:35:48 -03:00
										 |  |  | 		case CONTAINER_SPATIAL_EDITOR_SIDE_LEFT: { | 
					
						
							| 
									
										
										
										
											2022-01-08 20:31:22 +08:00
										 |  |  | 			Node3DEditor::get_singleton()->add_control_to_left_panel(p_control); | 
					
						
							| 
									
										
										
										
											2018-08-21 01:35:48 -03:00
										 |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: { | 
					
						
							| 
									
										
										
										
											2022-01-08 20:31:22 +08:00
										 |  |  | 			Node3DEditor::get_singleton()->add_control_to_right_panel(p_control); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_SPATIAL_EDITOR_BOTTOM: { | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | 			Node3DEditor::get_singleton()->get_shader_split()->add_child(p_control); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_CANVAS_EDITOR_MENU: { | 
					
						
							|  |  |  | 			CanvasItemEditor::get_singleton()->add_control_to_menu_panel(p_control); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2018-08-21 01:35:48 -03:00
										 |  |  | 		case CONTAINER_CANVAS_EDITOR_SIDE_LEFT: { | 
					
						
							| 
									
										
										
										
											2022-01-08 20:31:22 +08:00
										 |  |  | 			CanvasItemEditor::get_singleton()->add_control_to_left_panel(p_control); | 
					
						
							| 
									
										
										
										
											2018-08-21 01:35:48 -03:00
										 |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_CANVAS_EDITOR_SIDE_RIGHT: { | 
					
						
							| 
									
										
										
										
											2022-01-08 20:31:22 +08:00
										 |  |  | 			CanvasItemEditor::get_singleton()->add_control_to_right_panel(p_control); | 
					
						
							| 
									
										
										
										
											2015-01-11 20:52:42 -03:00
										 |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_CANVAS_EDITOR_BOTTOM: { | 
					
						
							|  |  |  | 			CanvasItemEditor::get_singleton()->get_bottom_split()->add_child(p_control); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2022-08-13 12:56:52 +02:00
										 |  |  | 		case CONTAINER_INSPECTOR_BOTTOM: { | 
					
						
							| 
									
										
										
										
											2021-11-17 21:08:55 +01:00
										 |  |  | 			InspectorDock::get_singleton()->get_addon_area()->add_child(p_control); | 
					
						
							| 
									
										
										
										
											2016-05-23 17:10:26 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2019-05-27 13:33:52 -07:00
										 |  |  | 		case CONTAINER_PROJECT_SETTING_TAB_LEFT: { | 
					
						
							|  |  |  | 			ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(p_control); | 
					
						
							|  |  |  | 			ProjectSettingsEditor::get_singleton()->get_tabs()->move_child(p_control, 0); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_PROJECT_SETTING_TAB_RIGHT: { | 
					
						
							|  |  |  | 			ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(p_control); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | void EditorPlugin::remove_control_from_container(CustomControlContainer p_location, Control *p_control) { | 
					
						
							| 
									
										
										
										
											2018-06-27 18:06:39 -05:00
										 |  |  | 	ERR_FAIL_NULL(p_control); | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	switch (p_location) { | 
					
						
							|  |  |  | 		case CONTAINER_TOOLBAR: { | 
					
						
							| 
									
										
										
										
											2023-04-12 21:02:28 +02:00
										 |  |  | 			EditorNode::get_title_bar()->remove_child(p_control); | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 		} break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		case CONTAINER_SPATIAL_EDITOR_MENU: { | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | 			Node3DEditor::get_singleton()->remove_control_from_menu_panel(p_control); | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2022-01-08 20:31:22 +08:00
										 |  |  | 		case CONTAINER_SPATIAL_EDITOR_SIDE_LEFT: { | 
					
						
							|  |  |  | 			Node3DEditor::get_singleton()->remove_control_from_left_panel(p_control); | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2018-08-21 01:35:48 -03:00
										 |  |  | 		case CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: { | 
					
						
							| 
									
										
										
										
											2022-01-08 20:31:22 +08:00
										 |  |  | 			Node3DEditor::get_singleton()->remove_control_from_right_panel(p_control); | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_SPATIAL_EDITOR_BOTTOM: { | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | 			Node3DEditor::get_singleton()->get_shader_split()->remove_child(p_control); | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_CANVAS_EDITOR_MENU: { | 
					
						
							|  |  |  | 			CanvasItemEditor::get_singleton()->remove_control_from_menu_panel(p_control); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2022-01-08 20:31:22 +08:00
										 |  |  | 		case CONTAINER_CANVAS_EDITOR_SIDE_LEFT: { | 
					
						
							|  |  |  | 			CanvasItemEditor::get_singleton()->remove_control_from_left_panel(p_control); | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2018-08-21 01:35:48 -03:00
										 |  |  | 		case CONTAINER_CANVAS_EDITOR_SIDE_RIGHT: { | 
					
						
							| 
									
										
										
										
											2022-01-08 20:31:22 +08:00
										 |  |  | 			CanvasItemEditor::get_singleton()->remove_control_from_right_panel(p_control); | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 		} break; | 
					
						
							|  |  |  | 		case CONTAINER_CANVAS_EDITOR_BOTTOM: { | 
					
						
							|  |  |  | 			CanvasItemEditor::get_singleton()->get_bottom_split()->remove_child(p_control); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2022-08-13 12:56:52 +02:00
										 |  |  | 		case CONTAINER_INSPECTOR_BOTTOM: { | 
					
						
							| 
									
										
										
										
											2021-11-17 21:08:55 +01:00
										 |  |  | 			InspectorDock::get_singleton()->get_addon_area()->remove_child(p_control); | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2019-05-27 13:33:52 -07:00
										 |  |  | 		case CONTAINER_PROJECT_SETTING_TAB_LEFT: | 
					
						
							|  |  |  | 		case CONTAINER_PROJECT_SETTING_TAB_RIGHT: { | 
					
						
							|  |  |  | 			ProjectSettingsEditor::get_singleton()->get_tabs()->remove_child(p_control); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-16 00:04:21 +01:00
										 |  |  | void EditorPlugin::add_tool_menu_item(const String &p_name, const Callable &p_callable) { | 
					
						
							|  |  |  | 	EditorNode::get_singleton()->add_tool_menu_item(p_name, p_callable); | 
					
						
							| 
									
										
										
										
											2016-08-07 11:01:22 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-28 15:06:54 +01:00
										 |  |  | void EditorPlugin::add_tool_submenu_item(const String &p_name, PopupMenu *p_submenu) { | 
					
						
							| 
									
										
										
										
											2016-08-07 11:01:22 -03:00
										 |  |  | 	ERR_FAIL_NULL(p_submenu); | 
					
						
							| 
									
										
										
										
											2022-01-28 15:06:54 +01:00
										 |  |  | 	EditorNode::get_singleton()->add_tool_submenu_item(p_name, p_submenu); | 
					
						
							| 
									
										
										
										
											2016-08-07 11:01:22 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_tool_menu_item(const String &p_name) { | 
					
						
							| 
									
										
										
										
											2018-03-16 21:50:35 -04:00
										 |  |  | 	EditorNode::get_singleton()->remove_tool_menu_item(p_name); | 
					
						
							| 
									
										
										
										
											2016-08-07 11:01:22 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-06 18:11:04 +05:30
										 |  |  | PopupMenu *EditorPlugin::get_export_as_menu() { | 
					
						
							|  |  |  | 	return EditorNode::get_singleton()->get_export_as_menu(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-08 19:57:35 +02:00
										 |  |  | void EditorPlugin::set_input_event_forwarding_always_enabled() { | 
					
						
							|  |  |  | 	input_event_forwarding_always_enabled = true; | 
					
						
							|  |  |  | 	EditorPluginList *always_input_forwarding_list = EditorNode::get_singleton()->get_editor_plugins_force_input_forwarding(); | 
					
						
							|  |  |  | 	always_input_forwarding_list->add_plugin(this); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-29 20:32:09 +01:00
										 |  |  | void EditorPlugin::set_force_draw_over_forwarding_enabled() { | 
					
						
							|  |  |  | 	force_draw_over_forwarding_enabled = true; | 
					
						
							|  |  |  | 	EditorPluginList *always_draw_over_forwarding_list = EditorNode::get_singleton()->get_editor_plugins_force_over(); | 
					
						
							|  |  |  | 	always_draw_over_forwarding_list->add_plugin(this); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-06 09:18:20 +02:00
										 |  |  | void EditorPlugin::notify_scene_changed(const Node *scn_root) { | 
					
						
							| 
									
										
										
										
											2021-07-17 18:22:52 -03:00
										 |  |  | 	emit_signal(SNAME("scene_changed"), scn_root); | 
					
						
							| 
									
										
										
										
											2017-07-06 09:18:20 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::notify_main_screen_changed(const String &screen_name) { | 
					
						
							| 
									
										
										
										
											2020-05-14 16:41:43 +02:00
										 |  |  | 	if (screen_name == last_main_screen_name) { | 
					
						
							| 
									
										
										
										
											2017-07-06 09:18:20 +02:00
										 |  |  | 		return; | 
					
						
							| 
									
										
										
										
											2020-05-14 16:41:43 +02:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-07-06 09:18:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-17 18:22:52 -03:00
										 |  |  | 	emit_signal(SNAME("main_screen_changed"), screen_name); | 
					
						
							| 
									
										
										
										
											2017-07-06 09:18:20 +02:00
										 |  |  | 	last_main_screen_name = screen_name; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::notify_scene_closed(const String &scene_filepath) { | 
					
						
							| 
									
										
										
										
											2021-07-17 18:22:52 -03:00
										 |  |  | 	emit_signal(SNAME("scene_closed"), scene_filepath); | 
					
						
							| 
									
										
										
										
											2017-07-06 09:18:20 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 15:43:29 -06:00
										 |  |  | void EditorPlugin::notify_resource_saved(const Ref<Resource> &p_resource) { | 
					
						
							| 
									
										
										
										
											2021-07-17 18:22:52 -03:00
										 |  |  | 	emit_signal(SNAME("resource_saved"), p_resource); | 
					
						
							| 
									
										
										
										
											2018-01-12 15:43:29 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-18 13:06:48 +01:00
										 |  |  | void EditorPlugin::notify_scene_saved(const String &p_scene_filepath) { | 
					
						
							|  |  |  | 	emit_signal(SNAME("scene_saved"), p_scene_filepath); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-15 22:33:25 +02:00
										 |  |  | bool EditorPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p_event) { | 
					
						
							| 
									
										
										
										
											2022-09-29 12:53:28 +03:00
										 |  |  | 	bool success = false; | 
					
						
							| 
									
										
										
										
											2022-10-18 18:47:44 +02:00
										 |  |  | 	GDVIRTUAL_CALL(_forward_canvas_gui_input, p_event, success); | 
					
						
							|  |  |  | 	return success; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2016-09-10 16:44:03 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-18 20:00:07 +02:00
										 |  |  | void EditorPlugin::forward_canvas_draw_over_viewport(Control *p_overlay) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_forward_canvas_draw_over_viewport, p_overlay); | 
					
						
							| 
									
										
										
										
											2016-09-10 16:44:03 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-18 20:00:07 +02:00
										 |  |  | void EditorPlugin::forward_canvas_force_draw_over_viewport(Control *p_overlay) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_forward_canvas_force_draw_over_viewport, p_overlay); | 
					
						
							| 
									
										
										
										
											2017-10-29 20:32:09 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Updates the overlays of the 2D viewport or, if in 3D mode, of every 3D viewport.
 | 
					
						
							|  |  |  | int EditorPlugin::update_overlays() const { | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | 	if (Node3DEditor::get_singleton()->is_visible()) { | 
					
						
							| 
									
										
										
										
											2017-10-29 20:32:09 +01:00
										 |  |  | 		int count = 0; | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | 		for (uint32_t i = 0; i < Node3DEditor::VIEWPORTS_COUNT; i++) { | 
					
						
							|  |  |  | 			Node3DEditorViewport *vp = Node3DEditor::get_singleton()->get_editor_viewport(i); | 
					
						
							| 
									
										
										
										
											2017-10-29 20:32:09 +01:00
										 |  |  | 			if (vp->is_visible()) { | 
					
						
							|  |  |  | 				vp->update_surface(); | 
					
						
							|  |  |  | 				count++; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		return count; | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		// This will update the normal viewport itself as well
 | 
					
						
							| 
									
										
										
										
											2022-08-13 23:21:24 +02:00
										 |  |  | 		CanvasItemEditor::get_singleton()->get_viewport_control()->queue_redraw(); | 
					
						
							| 
									
										
										
										
											2017-10-29 20:32:09 +01:00
										 |  |  | 		return 1; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2016-09-10 16:44:03 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 18:38:33 +02:00
										 |  |  | EditorPlugin::AfterGUIInput EditorPlugin::forward_3d_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { | 
					
						
							| 
									
										
										
										
											2022-09-29 12:53:28 +03:00
										 |  |  | 	int success = EditorPlugin::AFTER_GUI_INPUT_PASS; | 
					
						
							| 
									
										
										
										
											2022-10-18 18:47:44 +02:00
										 |  |  | 	GDVIRTUAL_CALL(_forward_3d_gui_input, p_camera, p_event, success); | 
					
						
							|  |  |  | 	return static_cast<EditorPlugin::AfterGUIInput>(success); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2018-09-18 20:00:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 18:38:33 +02:00
										 |  |  | void EditorPlugin::forward_3d_draw_over_viewport(Control *p_overlay) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_forward_3d_draw_over_viewport, p_overlay); | 
					
						
							| 
									
										
										
										
											2018-09-18 20:00:07 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 18:38:33 +02:00
										 |  |  | void EditorPlugin::forward_3d_force_draw_over_viewport(Control *p_overlay) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_forward_3d_force_draw_over_viewport, p_overlay); | 
					
						
							| 
									
										
										
										
											2018-09-18 20:00:07 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-05-14 14:29:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-12 19:42:12 -07:00
										 |  |  | String EditorPlugin::get_plugin_name() const { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	String name; | 
					
						
							| 
									
										
										
										
											2022-10-18 18:47:44 +02:00
										 |  |  | 	GDVIRTUAL_CALL(_get_plugin_name, name); | 
					
						
							|  |  |  | 	return name; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-05-14 14:29:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-12 19:42:12 -07:00
										 |  |  | const Ref<Texture2D> EditorPlugin::get_plugin_icon() const { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	Ref<Texture2D> icon; | 
					
						
							| 
									
										
										
										
											2022-10-18 18:47:44 +02:00
										 |  |  | 	GDVIRTUAL_CALL(_get_plugin_icon, icon); | 
					
						
							|  |  |  | 	return icon; | 
					
						
							| 
									
										
										
										
											2017-12-06 19:27:45 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-05-14 14:29:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-02 11:14:29 -07:00
										 |  |  | String EditorPlugin::get_plugin_version() const { | 
					
						
							|  |  |  | 	return plugin_version; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::set_plugin_version(const String &p_version) { | 
					
						
							|  |  |  | 	plugin_version = p_version; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | bool EditorPlugin::has_main_screen() const { | 
					
						
							| 
									
										
										
										
											2022-10-18 18:47:44 +02:00
										 |  |  | 	bool success = false; | 
					
						
							|  |  |  | 	GDVIRTUAL_CALL(_has_main_screen, success); | 
					
						
							|  |  |  | 	return success; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-05-14 14:29:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | void EditorPlugin::make_visible(bool p_visible) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_make_visible, p_visible); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::edit(Object *p_object) { | 
					
						
							| 
									
										
										
										
											2022-09-19 17:39:35 +01:00
										 |  |  | 	GDVIRTUAL_CALL(_edit, p_object); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool EditorPlugin::handles(Object *p_object) const { | 
					
						
							| 
									
										
										
										
											2022-09-29 12:53:28 +03:00
										 |  |  | 	bool success = false; | 
					
						
							| 
									
										
										
										
											2022-10-18 18:47:44 +02:00
										 |  |  | 	GDVIRTUAL_CALL(_handles, p_object, success); | 
					
						
							|  |  |  | 	return success; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-05-14 14:29:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-10 21:29:28 +02:00
										 |  |  | bool EditorPlugin::can_auto_hide() const { | 
					
						
							|  |  |  | 	return true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | Dictionary EditorPlugin::get_state() const { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	Dictionary state; | 
					
						
							| 
									
										
										
										
											2022-10-18 18:47:44 +02:00
										 |  |  | 	GDVIRTUAL_CALL(_get_state, state); | 
					
						
							|  |  |  | 	return state; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::set_state(const Dictionary &p_state) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_set_state, p_state); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::clear() { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_clear); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-05 15:45:41 +02:00
										 |  |  | String EditorPlugin::get_unsaved_status(const String &p_for_scene) const { | 
					
						
							| 
									
										
										
										
											2022-10-16 18:09:17 +02:00
										 |  |  | 	String ret; | 
					
						
							| 
									
										
										
										
											2023-04-05 15:45:41 +02:00
										 |  |  | 	GDVIRTUAL_CALL(_get_unsaved_status, p_for_scene, ret); | 
					
						
							| 
									
										
										
										
											2022-10-16 18:09:17 +02:00
										 |  |  | 	return ret; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-15 14:49:58 -03:00
										 |  |  | void EditorPlugin::save_external_data() { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_save_external_data); | 
					
						
							| 
									
										
										
										
											2016-08-15 14:49:58 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // if changes are pending in editor, apply them
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | void EditorPlugin::apply_changes() { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_apply_changes); | 
					
						
							| 
									
										
										
										
											2016-08-15 14:49:58 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::get_breakpoints(List<String> *p_breakpoints) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	PackedStringArray arr; | 
					
						
							|  |  |  | 	if (GDVIRTUAL_CALL(_get_breakpoints, arr)) { | 
					
						
							| 
									
										
										
										
											2020-05-14 16:41:43 +02:00
										 |  |  | 		for (int i = 0; i < arr.size(); i++) { | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 			p_breakpoints->push_back(arr[i]); | 
					
						
							| 
									
										
										
										
											2020-05-14 16:41:43 +02:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2020-05-14 14:29:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | bool EditorPlugin::get_remove_list(List<Node *> *p_list) { | 
					
						
							|  |  |  | 	return false; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-28 17:39:57 +02:00
										 |  |  | void EditorPlugin::add_undo_redo_inspector_hook_callback(Callable p_callable) { | 
					
						
							| 
									
										
										
										
											2023-08-11 15:55:47 +02:00
										 |  |  | 	EditorNode::get_editor_data().add_undo_redo_inspector_hook_callback(p_callable); | 
					
						
							| 
									
										
										
										
											2021-04-28 17:39:57 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_undo_redo_inspector_hook_callback(Callable p_callable) { | 
					
						
							| 
									
										
										
										
											2023-08-11 15:55:47 +02:00
										 |  |  | 	EditorNode::get_editor_data().remove_undo_redo_inspector_hook_callback(p_callable); | 
					
						
							| 
									
										
										
										
											2021-04-28 17:39:57 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-23 13:48:59 +02:00
										 |  |  | void EditorPlugin::add_translation_parser_plugin(const Ref<EditorTranslationParserPlugin> &p_parser) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_parser.is_null()); | 
					
						
							| 
									
										
										
										
											2020-06-23 13:48:59 +02:00
										 |  |  | 	EditorTranslationParser::get_singleton()->add_parser(p_parser, EditorTranslationParser::CUSTOM); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_translation_parser_plugin(const Ref<EditorTranslationParserPlugin> &p_parser) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_parser.is_null()); | 
					
						
							| 
									
										
										
										
											2020-06-23 13:48:59 +02:00
										 |  |  | 	EditorTranslationParser::get_singleton()->remove_parser(p_parser, EditorTranslationParser::CUSTOM); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-07 09:38:42 +01:00
										 |  |  | void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin> &p_importer, bool p_first_priority) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_importer.is_null()); | 
					
						
							| 
									
										
										
										
											2022-02-07 09:38:42 +01:00
										 |  |  | 	ResourceFormatImporter::get_singleton()->add_importer(p_importer, p_first_priority); | 
					
						
							| 
									
										
										
										
											2024-05-24 01:30:16 -04:00
										 |  |  | 	// Plugins are now loaded during the first scan. It's important not to start another scan,
 | 
					
						
							|  |  |  | 	// even a deferred one, as it would cause a scan during a scan at the next main thread iteration.
 | 
					
						
							|  |  |  | 	if (!EditorFileSystem::get_singleton()->doing_first_scan()) { | 
					
						
							|  |  |  | 		callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan).call_deferred(); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-04-09 00:37:31 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-11 17:18:22 +08:00
										 |  |  | void EditorPlugin::remove_import_plugin(const Ref<EditorImportPlugin> &p_importer) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_importer.is_null()); | 
					
						
							| 
									
										
										
										
											2017-06-11 17:18:22 +08:00
										 |  |  | 	ResourceFormatImporter::get_singleton()->remove_importer(p_importer); | 
					
						
							| 
									
										
										
										
											2024-05-24 01:30:16 -04:00
										 |  |  | 	// Plugins are now loaded during the first scan. It's important not to start another scan,
 | 
					
						
							|  |  |  | 	// even a deferred one, as it would cause a scan during a scan at the next main thread iteration.
 | 
					
						
							|  |  |  | 	if (!EditorNode::get_singleton()->is_exiting() && !EditorFileSystem::get_singleton()->doing_first_scan()) { | 
					
						
							| 
									
										
										
										
											2024-06-23 21:12:00 +03:00
										 |  |  | 		callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan).call_deferred(); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-06-11 17:18:22 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-14 19:38:38 -03:00
										 |  |  | void EditorPlugin::add_export_plugin(const Ref<EditorExportPlugin> &p_exporter) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_exporter.is_null()); | 
					
						
							| 
									
										
										
										
											2017-09-14 19:38:38 -03:00
										 |  |  | 	EditorExport::get_singleton()->add_export_plugin(p_exporter); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_export_plugin(const Ref<EditorExportPlugin> &p_exporter) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_exporter.is_null()); | 
					
						
							| 
									
										
										
										
											2017-09-14 19:38:38 -03:00
										 |  |  | 	EditorExport::get_singleton()->remove_export_plugin(p_exporter); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-17 10:44:44 +03:00
										 |  |  | void EditorPlugin::add_export_platform(const Ref<EditorExportPlatform> &p_platform) { | 
					
						
							|  |  |  | 	ERR_FAIL_COND(p_platform.is_null()); | 
					
						
							|  |  |  | 	EditorExport::get_singleton()->add_export_platform(p_platform); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_export_platform(const Ref<EditorExportPlatform> &p_platform) { | 
					
						
							|  |  |  | 	ERR_FAIL_COND(p_platform.is_null()); | 
					
						
							|  |  |  | 	EditorExport::get_singleton()->remove_export_platform(p_platform); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 18:38:33 +02:00
										 |  |  | void EditorPlugin::add_node_3d_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_gizmo_plugin.is_null()); | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | 	Node3DEditor::get_singleton()->add_gizmo_plugin(p_gizmo_plugin); | 
					
						
							| 
									
										
										
										
											2018-10-29 11:30:28 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 18:38:33 +02:00
										 |  |  | void EditorPlugin::remove_node_3d_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_gizmo_plugin.is_null()); | 
					
						
							| 
									
										
										
										
											2020-03-26 18:49:16 -03:00
										 |  |  | 	Node3DEditor::get_singleton()->remove_gizmo_plugin(p_gizmo_plugin); | 
					
						
							| 
									
										
										
										
											2018-10-29 11:30:28 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-17 18:02:16 -03:00
										 |  |  | void EditorPlugin::add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_plugin.is_null()); | 
					
						
							| 
									
										
										
										
											2018-05-17 18:02:16 -03:00
										 |  |  | 	EditorInspector::add_inspector_plugin(p_plugin); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_plugin.is_null()); | 
					
						
							| 
									
										
										
										
											2018-05-17 18:02:16 -03:00
										 |  |  | 	EditorInspector::remove_inspector_plugin(p_plugin); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-07 09:38:42 +01:00
										 |  |  | void EditorPlugin::add_scene_format_importer_plugin(const Ref<EditorSceneFormatImporter> &p_importer, bool p_first_priority) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_importer.is_null()); | 
					
						
							| 
									
										
										
										
											2023-10-08 00:48:53 -05:00
										 |  |  | 	ResourceImporterScene::add_scene_importer(p_importer, p_first_priority); | 
					
						
							| 
									
										
										
										
											2017-12-07 15:44:20 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:27 -03:00
										 |  |  | void EditorPlugin::remove_scene_format_importer_plugin(const Ref<EditorSceneFormatImporter> &p_importer) { | 
					
						
							| 
									
										
										
										
											2024-08-25 14:15:10 +02:00
										 |  |  | 	ERR_FAIL_COND(p_importer.is_null()); | 
					
						
							| 
									
										
										
										
											2023-10-08 00:48:53 -05:00
										 |  |  | 	ResourceImporterScene::remove_scene_importer(p_importer); | 
					
						
							| 
									
										
										
										
											2017-12-07 15:44:20 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-07 09:38:42 +01:00
										 |  |  | void EditorPlugin::add_scene_post_import_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin, bool p_first_priority) { | 
					
						
							| 
									
										
										
										
											2022-04-12 16:07:09 +02:00
										 |  |  | 	ResourceImporterScene::add_post_importer_plugin(p_plugin, p_first_priority); | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:27 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-07 09:38:42 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:27 -03:00
										 |  |  | void EditorPlugin::remove_scene_post_import_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin) { | 
					
						
							| 
									
										
										
										
											2022-04-12 16:07:09 +02:00
										 |  |  | 	ResourceImporterScene::remove_post_importer_plugin(p_plugin); | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:27 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-03 23:07:19 +02:00
										 |  |  | void EditorPlugin::add_context_menu_plugin(EditorContextMenuPlugin::ContextMenuSlot p_slot, const Ref<EditorContextMenuPlugin> &p_plugin) { | 
					
						
							|  |  |  | 	EditorContextMenuPluginManager::get_singleton()->add_plugin(p_slot, p_plugin); | 
					
						
							| 
									
										
										
										
											2024-07-21 16:43:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-03 23:07:19 +02:00
										 |  |  | void EditorPlugin::remove_context_menu_plugin(const Ref<EditorContextMenuPlugin> &p_plugin) { | 
					
						
							|  |  |  | 	EditorContextMenuPluginManager::get_singleton()->remove_plugin(p_plugin); | 
					
						
							| 
									
										
										
										
											2024-07-21 16:43:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-17 18:06:54 -03:00
										 |  |  | int find(const PackedStringArray &a, const String &v) { | 
					
						
							|  |  |  | 	const String *r = a.ptr(); | 
					
						
							| 
									
										
										
										
											2018-06-11 02:59:53 +02:00
										 |  |  | 	for (int j = 0; j < a.size(); ++j) { | 
					
						
							|  |  |  | 		if (r[j] == v) { | 
					
						
							|  |  |  | 			return j; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return -1; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::enable_plugin() { | 
					
						
							|  |  |  | 	// Called when the plugin gets enabled in project settings, after it's added to the tree.
 | 
					
						
							|  |  |  | 	// You can implement it to register autoloads.
 | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_enable_plugin); | 
					
						
							| 
									
										
										
										
											2018-06-11 02:59:53 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::disable_plugin() { | 
					
						
							|  |  |  | 	// Last function called when the plugin gets disabled in project settings.
 | 
					
						
							|  |  |  | 	// Implement it to cleanup things from the project, such as unregister autoloads.
 | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_disable_plugin); | 
					
						
							| 
									
										
										
										
											2018-06-11 02:59:53 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-22 00:03:19 -03:00
										 |  |  | void EditorPlugin::set_window_layout(Ref<ConfigFile> p_layout) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_set_window_layout, p_layout); | 
					
						
							| 
									
										
										
										
											2015-06-22 00:03:19 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::get_window_layout(Ref<ConfigFile> p_layout) { | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_CALL(_get_window_layout, p_layout); | 
					
						
							| 
									
										
										
										
											2016-08-15 14:49:58 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-08 09:55:22 -06:00
										 |  |  | bool EditorPlugin::build() { | 
					
						
							| 
									
										
										
										
											2022-10-18 18:47:44 +02:00
										 |  |  | 	bool success = true; | 
					
						
							|  |  |  | 	GDVIRTUAL_CALL(_build, success); | 
					
						
							|  |  |  | 	return success; | 
					
						
							| 
									
										
										
										
											2018-01-08 09:55:22 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-15 12:29:59 -03:00
										 |  |  | void EditorPlugin::queue_save_layout() { | 
					
						
							| 
									
										
										
										
											2023-05-11 04:17:03 +02:00
										 |  |  | 	EditorNode::get_singleton()->save_editor_layout_delayed(); | 
					
						
							| 
									
										
										
										
											2015-06-22 00:03:19 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-17 11:59:12 -03:00
										 |  |  | void EditorPlugin::make_bottom_panel_item_visible(Control *p_item) { | 
					
						
							| 
									
										
										
										
											2024-01-30 17:22:22 -05:00
										 |  |  | 	EditorNode::get_bottom_panel()->make_item_visible(p_item); | 
					
						
							| 
									
										
										
										
											2016-09-17 11:59:12 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::hide_bottom_panel() { | 
					
						
							| 
									
										
										
										
											2024-01-30 17:22:22 -05:00
										 |  |  | 	EditorNode::get_bottom_panel()->hide_bottom_panel(); | 
					
						
							| 
									
										
										
										
											2016-09-17 11:59:12 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-26 10:32:15 -03:00
										 |  |  | EditorInterface *EditorPlugin::get_editor_interface() { | 
					
						
							|  |  |  | 	return EditorInterface::get_singleton(); | 
					
						
							| 
									
										
										
										
											2016-09-10 17:34:27 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-29 22:08:28 -05:00
										 |  |  | ScriptCreateDialog *EditorPlugin::get_script_create_dialog() { | 
					
						
							| 
									
										
										
										
											2021-11-17 21:08:55 +01:00
										 |  |  | 	return SceneTreeDock::get_singleton()->get_script_create_dialog(); | 
					
						
							| 
									
										
										
										
											2018-06-29 22:08:28 -05:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-03 15:21:25 +02:00
										 |  |  | void EditorPlugin::add_debugger_plugin(const Ref<EditorDebuggerPlugin> &p_plugin) { | 
					
						
							|  |  |  | 	EditorDebuggerNode::get_singleton()->add_debugger_plugin(p_plugin); | 
					
						
							| 
									
										
										
										
											2020-05-18 20:25:49 +05:30
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-03 15:21:25 +02:00
										 |  |  | void EditorPlugin::remove_debugger_plugin(const Ref<EditorDebuggerPlugin> &p_plugin) { | 
					
						
							|  |  |  | 	EditorDebuggerNode::get_singleton()->remove_debugger_plugin(p_plugin); | 
					
						
							| 
									
										
										
										
											2020-05-18 20:25:49 +05:30
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-14 13:02:34 -07:00
										 |  |  | void EditorPlugin::add_resource_conversion_plugin(const Ref<EditorResourceConversionPlugin> &p_plugin) { | 
					
						
							|  |  |  | 	EditorNode::get_singleton()->add_resource_conversion_plugin(p_plugin); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void EditorPlugin::remove_resource_conversion_plugin(const Ref<EditorResourceConversionPlugin> &p_plugin) { | 
					
						
							|  |  |  | 	EditorNode::get_singleton()->remove_resource_conversion_plugin(p_plugin); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-09 17:52:01 +02:00
										 |  |  | #ifndef DISABLE_DEPRECATED
 | 
					
						
							| 
									
										
										
										
											2021-02-13 11:06:56 -03:00
										 |  |  | void EditorPlugin::_editor_project_settings_changed() { | 
					
						
							| 
									
										
										
										
											2021-07-17 18:22:52 -03:00
										 |  |  | 	emit_signal(SNAME("project_settings_changed")); | 
					
						
							| 
									
										
										
										
											2021-02-13 11:06:56 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-08-09 17:52:01 +02:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-13 11:06:56 -03:00
										 |  |  | void EditorPlugin::_notification(int p_what) { | 
					
						
							| 
									
										
										
										
											2023-08-09 17:52:01 +02:00
										 |  |  | #ifndef DISABLE_DEPRECATED
 | 
					
						
							| 
									
										
										
										
											2022-02-16 00:52:32 +01:00
										 |  |  | 	switch (p_what) { | 
					
						
							|  |  |  | 		case NOTIFICATION_ENTER_TREE: { | 
					
						
							| 
									
										
										
										
											2023-08-09 17:52:01 +02:00
										 |  |  | 			ProjectSettings::get_singleton()->connect("settings_changed", callable_mp(this, &EditorPlugin::_editor_project_settings_changed)); | 
					
						
							| 
									
										
										
										
											2022-02-16 00:52:32 +01:00
										 |  |  | 		} break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		case NOTIFICATION_EXIT_TREE: { | 
					
						
							| 
									
										
										
										
											2023-08-09 17:52:01 +02:00
										 |  |  | 			ProjectSettings::get_singleton()->disconnect("settings_changed", callable_mp(this, &EditorPlugin::_editor_project_settings_changed)); | 
					
						
							| 
									
										
										
										
											2022-02-16 00:52:32 +01:00
										 |  |  | 		} break; | 
					
						
							| 
									
										
										
										
											2021-02-13 11:06:56 -03:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2023-08-09 17:52:01 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2021-02-13 11:06:56 -03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | void EditorPlugin::_bind_methods() { | 
					
						
							| 
									
										
										
										
											2017-08-09 13:19:41 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_control_to_container", "container", "control"), &EditorPlugin::add_control_to_container); | 
					
						
							| 
									
										
										
										
											2024-02-08 00:08:07 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel", "control", "title", "shortcut"), &EditorPlugin::add_control_to_bottom_panel, DEFVAL(Ref<Shortcut>())); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("add_control_to_dock", "slot", "control", "shortcut"), &EditorPlugin::add_control_to_dock, DEFVAL(Ref<Shortcut>())); | 
					
						
							| 
									
										
										
										
											2017-08-09 13:19:41 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("remove_control_from_docks", "control"), &EditorPlugin::remove_control_from_docks); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel", "control"), &EditorPlugin::remove_control_from_bottom_panel); | 
					
						
							| 
									
										
										
										
											2018-02-13 19:21:19 -02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("remove_control_from_container", "container", "control"), &EditorPlugin::remove_control_from_container); | 
					
						
							| 
									
										
										
										
											2024-04-20 12:43:19 +08:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("set_dock_tab_icon", "control", "icon"), &EditorPlugin::set_dock_tab_icon); | 
					
						
							| 
									
										
										
										
											2020-12-16 00:04:21 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_tool_menu_item", "name", "callable"), &EditorPlugin::add_tool_menu_item); | 
					
						
							| 
									
										
										
										
											2017-08-09 13:19:41 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_tool_submenu_item", "name", "submenu"), &EditorPlugin::add_tool_submenu_item); | 
					
						
							| 
									
										
										
										
											2018-03-16 21:50:35 -04:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("remove_tool_menu_item", "name"), &EditorPlugin::remove_tool_menu_item); | 
					
						
							| 
									
										
										
										
											2022-04-06 18:11:04 +05:30
										 |  |  | 	ClassDB::bind_method(D_METHOD("get_export_as_menu"), &EditorPlugin::get_export_as_menu); | 
					
						
							| 
									
										
										
										
											2017-08-09 13:19:41 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_custom_type", "type", "base", "script", "icon"), &EditorPlugin::add_custom_type); | 
					
						
							| 
									
										
										
										
											2017-02-13 12:47:24 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("remove_custom_type", "type"), &EditorPlugin::remove_custom_type); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-13 22:31:38 -06:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_autoload_singleton", "name", "path"), &EditorPlugin::add_autoload_singleton); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_autoload_singleton", "name"), &EditorPlugin::remove_autoload_singleton); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-29 20:32:09 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("update_overlays"), &EditorPlugin::update_overlays); | 
					
						
							| 
									
										
										
										
											2017-02-13 12:47:24 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-09 13:19:41 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("make_bottom_panel_item_visible", "item"), &EditorPlugin::make_bottom_panel_item_visible); | 
					
						
							| 
									
										
										
										
											2017-02-13 12:47:24 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-25 18:06:46 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("get_undo_redo"), &EditorPlugin::get_undo_redo); | 
					
						
							| 
									
										
										
										
											2021-04-28 17:39:57 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_undo_redo_inspector_hook_callback", "callable"), &EditorPlugin::add_undo_redo_inspector_hook_callback); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_undo_redo_inspector_hook_callback", "callable"), &EditorPlugin::remove_undo_redo_inspector_hook_callback); | 
					
						
							| 
									
										
										
										
											2017-02-13 12:47:24 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout); | 
					
						
							| 
									
										
										
										
											2020-06-23 13:48:59 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_translation_parser_plugin", "parser"), &EditorPlugin::add_translation_parser_plugin); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_translation_parser_plugin", "parser"), &EditorPlugin::remove_translation_parser_plugin); | 
					
						
							| 
									
										
										
										
											2022-02-07 09:38:42 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_import_plugin", "importer", "first_priority"), &EditorPlugin::add_import_plugin, DEFVAL(false)); | 
					
						
							| 
									
										
										
										
											2017-08-09 13:19:41 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("remove_import_plugin", "importer"), &EditorPlugin::remove_import_plugin); | 
					
						
							| 
									
										
										
										
											2022-02-07 09:38:42 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_scene_format_importer_plugin", "scene_format_importer", "first_priority"), &EditorPlugin::add_scene_format_importer_plugin, DEFVAL(false)); | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:27 -03:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("remove_scene_format_importer_plugin", "scene_format_importer"), &EditorPlugin::remove_scene_format_importer_plugin); | 
					
						
							| 
									
										
										
										
											2022-02-07 09:38:42 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_scene_post_import_plugin", "scene_import_plugin", "first_priority"), &EditorPlugin::add_scene_post_import_plugin, DEFVAL(false)); | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:27 -03:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("remove_scene_post_import_plugin", "scene_import_plugin"), &EditorPlugin::remove_scene_post_import_plugin); | 
					
						
							| 
									
										
										
										
											2018-05-17 18:02:16 -03:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_export_plugin", "plugin"), &EditorPlugin::add_export_plugin); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_export_plugin", "plugin"), &EditorPlugin::remove_export_plugin); | 
					
						
							| 
									
										
										
										
											2024-04-17 10:44:44 +03:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_export_platform", "platform"), &EditorPlugin::add_export_platform); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_export_platform", "platform"), &EditorPlugin::remove_export_platform); | 
					
						
							| 
									
										
										
										
											2022-09-08 18:38:33 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_node_3d_gizmo_plugin", "plugin"), &EditorPlugin::add_node_3d_gizmo_plugin); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_node_3d_gizmo_plugin", "plugin"), &EditorPlugin::remove_node_3d_gizmo_plugin); | 
					
						
							| 
									
										
										
										
											2018-05-17 18:02:16 -03:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_inspector_plugin", "plugin"), &EditorPlugin::add_inspector_plugin); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_inspector_plugin", "plugin"), &EditorPlugin::remove_inspector_plugin); | 
					
						
							| 
									
										
										
										
											2023-01-14 13:02:34 -07:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_resource_conversion_plugin", "plugin"), &EditorPlugin::add_resource_conversion_plugin); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_resource_conversion_plugin", "plugin"), &EditorPlugin::remove_resource_conversion_plugin); | 
					
						
							| 
									
										
										
										
											2017-06-08 19:57:35 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("set_input_event_forwarding_always_enabled"), &EditorPlugin::set_input_event_forwarding_always_enabled); | 
					
						
							| 
									
										
										
										
											2017-10-29 20:32:09 +01:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("set_force_draw_over_forwarding_enabled"), &EditorPlugin::set_force_draw_over_forwarding_enabled); | 
					
						
							| 
									
										
										
										
											2024-07-21 16:43:53 +08:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_context_menu_plugin", "slot", "plugin"), &EditorPlugin::add_context_menu_plugin); | 
					
						
							| 
									
										
										
										
											2024-09-03 23:07:19 +02:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("remove_context_menu_plugin", "plugin"), &EditorPlugin::remove_context_menu_plugin); | 
					
						
							| 
									
										
										
										
											2017-08-26 10:32:15 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("get_editor_interface"), &EditorPlugin::get_editor_interface); | 
					
						
							| 
									
										
										
										
											2018-06-29 22:08:28 -05:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("get_script_create_dialog"), &EditorPlugin::get_script_create_dialog); | 
					
						
							| 
									
										
										
										
											2020-05-18 20:25:49 +05:30
										 |  |  | 	ClassDB::bind_method(D_METHOD("add_debugger_plugin", "script"), &EditorPlugin::add_debugger_plugin); | 
					
						
							|  |  |  | 	ClassDB::bind_method(D_METHOD("remove_debugger_plugin", "script"), &EditorPlugin::remove_debugger_plugin); | 
					
						
							| 
									
										
										
										
											2023-07-02 11:14:29 -07:00
										 |  |  | 	ClassDB::bind_method(D_METHOD("get_plugin_version"), &EditorPlugin::get_plugin_version); | 
					
						
							| 
									
										
										
										
											2017-07-06 09:18:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_BIND(_forward_canvas_gui_input, "event"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_forward_canvas_draw_over_viewport, "viewport_control"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_forward_canvas_force_draw_over_viewport, "viewport_control"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_forward_3d_gui_input, "viewport_camera", "event"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_forward_3d_draw_over_viewport, "viewport_control"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_forward_3d_force_draw_over_viewport, "viewport_control"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_get_plugin_name); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_get_plugin_icon); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_has_main_screen); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_make_visible, "visible"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_edit, "object"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_handles, "object"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_get_state); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_set_state, "state"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_clear); | 
					
						
							| 
									
										
										
										
											2023-04-05 15:45:41 +02:00
										 |  |  | 	GDVIRTUAL_BIND(_get_unsaved_status, "for_scene"); | 
					
						
							| 
									
										
										
										
											2021-08-21 22:52:44 -03:00
										 |  |  | 	GDVIRTUAL_BIND(_save_external_data); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_apply_changes); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_get_breakpoints); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_set_window_layout, "configuration"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_get_window_layout, "configuration"); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_build); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_enable_plugin); | 
					
						
							|  |  |  | 	GDVIRTUAL_BIND(_disable_plugin); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-29 07:15:46 +02:00
										 |  |  | 	ADD_SIGNAL(MethodInfo("scene_changed", PropertyInfo(Variant::OBJECT, "scene_root", PROPERTY_HINT_RESOURCE_TYPE, "Node"))); | 
					
						
							|  |  |  | 	ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "filepath"))); | 
					
						
							|  |  |  | 	ADD_SIGNAL(MethodInfo("main_screen_changed", PropertyInfo(Variant::STRING, "screen_name"))); | 
					
						
							| 
									
										
										
										
											2018-01-12 15:43:29 -06:00
										 |  |  | 	ADD_SIGNAL(MethodInfo("resource_saved", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource"))); | 
					
						
							| 
									
										
										
										
											2024-01-18 13:06:48 +01:00
										 |  |  | 	ADD_SIGNAL(MethodInfo("scene_saved", PropertyInfo(Variant::STRING, "filepath"))); | 
					
						
							| 
									
										
										
										
											2021-02-13 11:06:56 -03:00
										 |  |  | 	ADD_SIGNAL(MethodInfo("project_settings_changed")); | 
					
						
							| 
									
										
										
										
											2017-07-06 09:18:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-20 17:45:01 +02:00
										 |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_TOOLBAR); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU); | 
					
						
							| 
									
										
										
										
											2018-08-21 01:35:48 -03:00
										 |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE_LEFT); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT); | 
					
						
							| 
									
										
										
										
											2017-08-20 17:45:01 +02:00
										 |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_BOTTOM); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_MENU); | 
					
						
							| 
									
										
										
										
											2018-08-21 01:35:48 -03:00
										 |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE_LEFT); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE_RIGHT); | 
					
						
							| 
									
										
										
										
											2017-10-22 01:58:02 +07:00
										 |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_BOTTOM); | 
					
						
							| 
									
										
										
										
											2022-08-13 12:56:52 +02:00
										 |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_INSPECTOR_BOTTOM); | 
					
						
							| 
									
										
										
										
											2019-05-27 13:33:52 -07:00
										 |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_PROJECT_SETTING_TAB_LEFT); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(CONTAINER_PROJECT_SETTING_TAB_RIGHT); | 
					
						
							| 
									
										
										
										
											2017-08-20 17:45:01 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_LEFT_UL); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_LEFT_BL); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_LEFT_UR); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_LEFT_BR); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_UL); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_BL); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_UR); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_BR); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(DOCK_SLOT_MAX); | 
					
						
							| 
									
										
										
										
											2022-08-16 03:04:17 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_PASS); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_STOP); | 
					
						
							|  |  |  | 	BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_CUSTOM); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-23 23:53:16 +01:00
										 |  |  | EditorUndoRedoManager *EditorPlugin::get_undo_redo() { | 
					
						
							|  |  |  | 	return EditorUndoRedoManager::get_singleton(); | 
					
						
							| 
									
										
										
										
											2022-03-25 18:06:46 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | EditorPluginCreateFunc EditorPlugins::creation_funcs[MAX_CREATE_FUNCS]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int EditorPlugins::creation_func_count = 0; |