summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index a34aebc63a..f099f29204 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -66,8 +66,11 @@
#include "editor/import/resource_importer_scene.h"
#include "editor/import/resource_importer_texture.h"
#include "editor/import/resource_importer_wav.h"
+#include "editor/plugins/animation_blend_space_1d_editor.h"
+#include "editor/plugins/animation_blend_space_2d_editor.h"
#include "editor/plugins/animation_blend_tree_editor_plugin.h"
#include "editor/plugins/animation_player_editor_plugin.h"
+#include "editor/plugins/animation_state_machine_editor.h"
#include "editor/plugins/animation_tree_editor_plugin.h"
#include "editor/plugins/asset_library_editor_plugin.h"
#include "editor/plugins/baked_lightmap_editor_plugin.h"
@@ -96,6 +99,7 @@
#include "editor/plugins/physical_bone_plugin.h"
#include "editor/plugins/polygon_2d_editor_plugin.h"
#include "editor/plugins/resource_preloader_editor_plugin.h"
+#include "editor/plugins/root_motion_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/plugins/script_text_editor.h"
#include "editor/plugins/shader_editor_plugin.h"
@@ -583,7 +587,6 @@ void EditorNode::edit_node(Node *p_node) {
void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const String &p_path) {
editor_data.apply_changes_in_editors();
-
int flg = 0;
if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources"))
flg |= ResourceSaver::FLAG_COMPRESS;
@@ -1070,8 +1073,7 @@ void EditorNode::_save_scene(String p_file, int idx) {
void EditorNode::_save_all_scenes() {
- int i = _next_unsaved_scene(true, 0);
- while (i != -1) {
+ for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
Node *scene = editor_data.get_edited_scene_root(i);
if (scene && scene->get_filename() != "") {
if (i != editor_data.get_edited_scene())
@@ -1079,7 +1081,6 @@ void EditorNode::_save_all_scenes() {
else
_save_scene_with_preview(scene->get_filename());
} // else: ignore new scenes
- i = _next_unsaved_scene(true, ++i);
}
_save_default_environment();
@@ -1308,7 +1309,11 @@ bool EditorNode::item_has_editor(Object *p_object) {
void EditorNode::edit_item(Object *p_object) {
- Vector<EditorPlugin *> sub_plugins = editor_data.get_subeditors(p_object);
+ Vector<EditorPlugin *> sub_plugins;
+
+ if (p_object) {
+ sub_plugins = editor_data.get_subeditors(p_object);
+ }
if (!sub_plugins.empty()) {
_display_top_editors(false);
@@ -1316,6 +1321,8 @@ void EditorNode::edit_item(Object *p_object) {
_set_top_editors(sub_plugins);
_set_editing_top_editors(p_object);
_display_top_editors(true);
+ } else {
+ _hide_top_editors();
}
}
@@ -1349,8 +1356,7 @@ void EditorNode::_save_default_environment() {
if (fallback.is_valid() && fallback->get_path().is_resource_file()) {
Map<RES, bool> processed;
_find_and_save_edited_subresources(fallback.ptr(), processed, 0);
- if (fallback->get_last_modified_time() != fallback->get_import_last_modified_time())
- save_resource_in_path(fallback, fallback->get_path());
+ save_resource_in_path(fallback, fallback->get_path());
}
}
@@ -4626,6 +4632,10 @@ EditorNode::EditorNode() {
Ref<EditorInspectorDefaultPlugin> eidp;
eidp.instance();
EditorInspector::add_inspector_plugin(eidp);
+
+ Ref<EditorInspectorRootMotionPlugin> rmp;
+ rmp.instance();
+ EditorInspector::add_inspector_plugin(rmp);
}
_pvrtc_register_compressors();
@@ -4651,9 +4661,7 @@ EditorNode::EditorNode() {
GLOBAL_DEF("editor/main_run_args", "");
- ClassDB::set_class_enabled("CollisionShape", true);
- ClassDB::set_class_enabled("CollisionShape2D", true);
- ClassDB::set_class_enabled("CollisionPolygon2D", true);
+ ClassDB::set_class_enabled("RootMotionView", true);
//defs here, use EDITOR_GET in logic
EDITOR_DEF("interface/scene_tabs/always_show_close_button", false);
@@ -5371,8 +5379,6 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(SpatialEditorPlugin(this)));
add_editor_plugin(memnew(ScriptEditorPlugin(this)));
- add_editor_plugin(memnew(AnimationNodeBlendTreeEditorPlugin(this)));
-
EditorAudioBuses *audio_bus_editor = EditorAudioBuses::register_editor();
ScriptTextEditor::register_editor(); //register one for text scripts
@@ -5394,6 +5400,10 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(ShaderEditorPlugin(this)));
// FIXME: Disabled for Godot 3.0 as made incompatible, it needs to be ported to the new API.
//add_editor_plugin(memnew(ShaderGraphEditorPlugin(this)));
+ add_editor_plugin(memnew(AnimationNodeBlendTreeEditorPlugin(this)));
+ add_editor_plugin(memnew(AnimationNodeBlendSpace1DEditorPlugin(this)));
+ add_editor_plugin(memnew(AnimationNodeBlendSpace2DEditorPlugin(this)));
+ add_editor_plugin(memnew(AnimationNodeStateMachineEditorPlugin(this)));
add_editor_plugin(memnew(CameraEditorPlugin(this)));
add_editor_plugin(memnew(ThemeEditorPlugin(this)));