diff options
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r-- | tools/editor/editor_node.cpp | 109 |
1 files changed, 4 insertions, 105 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index a137b6cd34..701704fbfa 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -33,8 +33,6 @@ #include "editor_fonts.h" #include "editor_help.h" -#include "scene/io/scene_saver.h" -#include "scene/io/scene_loader.h" #include "core/io/resource_saver.h" #include "core/io/resource_loader.h" #include "servers/physics_2d_server.h" @@ -71,6 +69,7 @@ #include "plugins/item_list_editor_plugin.h" #include "plugins/stream_editor_plugin.h" #include "plugins/multimesh_editor_plugin.h" +#include "plugins/mesh_editor_plugin.h" #include "plugins/theme_editor_plugin.h" #include "plugins/tile_map_editor_plugin.h" @@ -233,25 +232,6 @@ void EditorNode::_notification(int p_what) { if (defer_load_scene!="") { -#ifdef OLD_SCENE_FORMAT_ENABLED - - if (convert_old) { - get_scene()->quit(); - Node *scn = SceneLoader::load(defer_load_scene,true); - ERR_EXPLAIN("Couldn't load scene: "+defer_load_scene); - ERR_FAIL_COND(!scn); - Ref<PackedScene> sdata = memnew( PackedScene ); - Error err = sdata->pack(scn); - ERR_EXPLAIN("Couldn't repack scene: "+defer_load_scene); - ERR_FAIL_COND(err!=OK); - err = ResourceSaver::save(defer_load_scene,sdata); - ERR_EXPLAIN("Couldn't resave scene: "+defer_load_scene); - ERR_FAIL_COND(err!=OK); - - return; - } - -#endif load_scene(defer_load_scene); defer_load_scene=""; } @@ -886,65 +866,6 @@ void EditorNode::_dialog_action(String p_file) { load_scene(p_file); } break; -#ifdef OLD_SCENE_FORMAT_ENABLED - case FILE_OPEN_OLD_SCENE: { - - String lpath = Globals::get_singleton()->localize_path(p_file); - if (!lpath.begins_with("res://")) { - - current_option=-1; - //accept->get_cancel()->hide(); - accept->get_ok()->set_text("Ugh"); - accept->set_text("Error loading scene, it must be inside the project path. Use 'Import' to open the scene, then save it inside the project path."); - accept->popup_centered(Size2(300,120)); - return ; - } - - Node*new_scene=SceneLoader::load(lpath,true); - - if (!new_scene) { - - current_option=-1; - //accept->get_cancel()->hide(); - accept->get_ok()->set_text("Ugh"); - accept->set_text("Error loading scene."); - accept->popup_centered(Size2(300,70));; - return ; - } - - Node *old_scene = edited_scene; - _hide_top_editors(); - set_edited_scene(NULL); - editor_data.clear_editor_states(); - if (old_scene) { - memdelete(old_scene); - } - - set_edited_scene(new_scene); - scene_tree_dock->set_selected(new_scene); - _get_scene_metadata(); - - editor_data.get_undo_redo().clear_history(); - saved_version=editor_data.get_undo_redo().get_version(); - _update_title(); - - _add_to_recent_scenes(lpath); - - if (new_scene->has_meta("__editor_plugin_screen__")) { - - String editor = new_scene->get_meta("__editor_plugin_screen__"); - for(int i=0;i<editor_table.size();i++) { - - if (editor_table[i]->get_name()==editor) { - _editor_select(i); - break; - } - } - } - - - } break; -#endif case FILE_SAVE_OPTIMIZED: { @@ -1679,28 +1600,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { open_request(previous_scenes.back()->get()); } break; -#ifdef OLD_SCENE_FORMAT_ENABLED - case FILE_OPEN_OLD_SCENE: { - - //print_tree(); - file->set_mode(FileDialog::MODE_OPEN_FILE); - //not for now? - file->clear_filters(); - file->add_filter("*.xml"); - - - //file->set_current_path(current_path); - Node *scene = edited_scene; - if (scene) { - file->set_current_path(scene->get_filename()); - }; - file->set_title("Open Scene"); - file->popup_centered_ratio(); - - - } break; - -#endif case FILE_SAVE_SCENE: { @@ -2438,6 +2337,8 @@ void EditorNode::set_edited_scene(Node *p_scene) { if (edited_scene && edited_scene->cast_to<Popup>()) edited_scene->cast_to<Popup>()->show(); //show popups scene_tree_dock->set_edited_scene(edited_scene); + if (get_scene()) + get_scene()->set_edited_scene_root(edited_scene); if (edited_scene) { if (p_scene->get_parent()!=scene_root) @@ -3549,9 +3450,6 @@ EditorNode::EditorNode() { p=import_menu->get_popup(); p->add_item("Sub-Scene",FILE_IMPORT_SUBSCENE); -#ifdef OLD_SCENE_FORMAT_ENABLED - p->add_item("Import Old Scene",FILE_OPEN_OLD_SCENE); -#endif p->add_separator(); p->connect("item_pressed",this,"_menu_option"); @@ -4079,6 +3977,7 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( SampleLibraryEditorPlugin(this) ) ); add_editor_plugin( memnew( ThemeEditorPlugin(this) ) ); add_editor_plugin( memnew( MultiMeshEditorPlugin(this) ) ); + add_editor_plugin( memnew( MeshInstanceEditorPlugin(this) ) ); add_editor_plugin( memnew( AnimationTreeEditorPlugin(this) ) ); add_editor_plugin( memnew( SamplePlayerEditorPlugin(this) ) ); add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) ); |