aboutsummaryrefslogtreecommitdiff
path: root/editor/editor_plugin.cpp
diff options
context:
space:
mode:
authorAndreas Haas2017-04-09 00:37:31 +0200
committerAndreas Haas2017-05-12 12:46:25 +0200
commitc04604461d9b17c69831f758489087b07fe032e1 (patch)
tree990763a25816d546a32f9621ed9322c5dc133ce4 /editor/editor_plugin.cpp
parent99e07448d1bb67f4b10e2234b5f2f18a0acf5de2 (diff)
downloadgodot-c04604461d9b17c69831f758489087b07fe032e1.tar.gz
godot-c04604461d9b17c69831f758489087b07fe032e1.tar.zst
godot-c04604461d9b17c69831f758489087b07fe032e1.zip
Bring back EditorImportPlugin
This adds a new implementation of the EditorImportPlugin class, allowing to leverage the new importing system via tool scripts. Will be especially useful when used together with GDNative, to support formats like fbx :)
Diffstat (limited to 'editor/editor_plugin.cpp')
-rw-r--r--editor/editor_plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 405784a7e..5e5b31aac 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -276,6 +276,11 @@ bool EditorPlugin::get_remove_list(List<Node *> *p_list) {
void EditorPlugin::restore_global_state() {}
void EditorPlugin::save_global_state() {}
+void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin> &p_importer) {
+ ResourceFormatImporter::get_singleton()->add_importer(p_importer);
+ EditorFileSystem::get_singleton()->scan_changes();
+}
+
void EditorPlugin::set_window_layout(Ref<ConfigFile> p_layout) {
if (get_script_instance() && get_script_instance()->has_method("set_window_layout")) {
@@ -360,7 +365,7 @@ void EditorPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_editor_settings:EditorSettings"), &EditorPlugin::get_editor_settings);
ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout);
ClassDB::bind_method(D_METHOD("edit_resource"), &EditorPlugin::edit_resource);
-
+ ClassDB::bind_method(D_METHOD("add_import_plugin"), &EditorPlugin::add_import_plugin);
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::INPUT_EVENT, "event")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_draw_over_canvas", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "canvas:Control")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::INPUT_EVENT, "event")));