aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/io_plugins
diff options
context:
space:
mode:
authorJuan Linietsky2016-02-27 23:10:44 -0300
committerJuan Linietsky2016-02-27 23:12:27 -0300
commit6fc1c3a4d1cf0c865f7dfdb1221ef07a5d25f305 (patch)
treef3871d453b8dafac043cdb3a7488717f3170be77 /tools/editor/io_plugins
parenta97c1ca8f9f22aca758ebc778d8eb34b3f9ccc39 (diff)
downloadgodot-6fc1c3a4d1cf0c865f7dfdb1221ef07a5d25f305.tar.gz
godot-6fc1c3a4d1cf0c865f7dfdb1221ef07a5d25f305.tar.zst
godot-6fc1c3a4d1cf0c865f7dfdb1221ef07a5d25f305.zip
Completed the support for plugins! It is not possible to add plugins.
Not all APIs are provided yet, please request whathever you are missing. Some example plugins are provided in demos/plugins. Just copy them to a folder in your project named addons/ and then enable them from the project settings. Have fun!
Diffstat (limited to 'tools/editor/io_plugins')
-rw-r--r--tools/editor/io_plugins/editor_font_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp11
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp
index 9b4ca246e..ff126a8e8 100644
--- a/tools/editor/io_plugins/editor_font_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp
@@ -540,7 +540,7 @@ class EditorFontImportDialog : public ConfirmationDialog {
return;
}
- //_import_inc(dest->get_line_edit()->get_text());
+ _import_inc(dest->get_line_edit()->get_text());
hide();
}
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index a3b6827cd..322320780 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -57,11 +57,12 @@ void EditorScenePostImport::_bind_methods() {
}
-Error EditorScenePostImport::post_import(Node* p_scene) {
+Node *EditorScenePostImport::post_import(Node* p_scene) {
if (get_script_instance())
- return Error(int(get_script_instance()->call("post_import",p_scene)));
- return OK;
+ return get_script_instance()->call("post_import",p_scene);
+
+ return p_scene;
}
EditorScenePostImport::EditorScenePostImport() {
@@ -2748,8 +2749,8 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
if (post_import_script.is_valid()) {
- err = post_import_script->post_import(scene);
- if (err) {
+ scene = post_import_script->post_import(scene);
+ if (!scene) {
EditorNode::add_io_error("Error running Post-Import script: '"+post_import_script_path);
return err;
}
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.h b/tools/editor/io_plugins/editor_scene_import_plugin.h
index 1f3b73fe7..a1a090de7 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.h
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.h
@@ -87,7 +87,7 @@ protected:
static void _bind_methods();
public:
- virtual Error post_import(Node* p_scene);
+ virtual Node* post_import(Node* p_scene);
EditorScenePostImport();
};