summaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r--tools/editor/editor_node.cpp76
1 files changed, 45 insertions, 31 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 5a3deb7b9d..46e7f0a42f 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 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 */
@@ -99,6 +99,7 @@
#include "plugins/light_occluder_2d_editor_plugin.h"
#include "plugins/color_ramp_editor_plugin.h"
#include "plugins/collision_shape_2d_editor_plugin.h"
+#include "plugins/gi_probe_editor_plugin.h"
#include "main/input_default.h"
// end
#include "tools/editor/editor_settings.h"
@@ -267,16 +268,14 @@ void EditorNode::_notification(int p_what) {
circle_step=0;
circle_step_msec=tick;
- circle_step_frame=frame+1;
+ circle_step_frame=frame+1;
- // update the circle itself only when its enabled
- if (!update_menu->get_popup()->is_item_checked(3)){
- update_menu->set_icon(gui_base->get_icon("Progress"+itos(circle_step+1),"EditorIcons"));
- }
+ // update the circle itself only when its enabled
+ if (!update_menu->get_popup()->is_item_checked(3)){
+ update_menu->set_icon(gui_base->get_icon("Progress"+itos(circle_step+1),"EditorIcons"));
+ }
}
- scene_root->set_size_override(true,Size2(Globals::get_singleton()->get("display/width"),Globals::get_singleton()->get("display/height")));
-
editor_selection->update();
{
@@ -303,7 +302,7 @@ void EditorNode::_notification(int p_what) {
}
if (p_what==NOTIFICATION_ENTER_TREE) {
-
+ get_tree()->get_root()->set_disable_3d(true);
//MessageQueue::get_singleton()->push_call(this,"_get_scene_metadata");
get_tree()->set_editor_hint(true);
get_tree()->get_root()->set_as_audio_listener(false);
@@ -910,10 +909,11 @@ void EditorNode::_save_scene_with_preview(String p_file) {
_editor_select(is2d?EDITOR_2D:EDITOR_3D);
- VS::get_singleton()->viewport_queue_screen_capture(viewport);
+
save.step(TTR("Creating Thumbnail"),2);
save.step(TTR("Creating Thumbnail"),3);
- Image img = VS::get_singleton()->viewport_get_screen_capture(viewport);
+#if 0
+ Image img = VS::get_singleton()->viewport_texture(scree_capture(viewport);
int preview_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");;
preview_size*=EDSCALE;
int width,height;
@@ -931,7 +931,7 @@ void EditorNode::_save_scene_with_preview(String p_file) {
height=img.get_height();
}
- img.convert(Image::FORMAT_RGB);
+ img.convert(Image::FORMAT_RGB8);
img.resize(width,height);
String pfile = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/last_scene_preview.png");
@@ -943,7 +943,7 @@ void EditorNode::_save_scene_with_preview(String p_file) {
if (editor_data.get_edited_scene_import_metadata().is_null())
editor_data.set_edited_scene_import_metadata(Ref<ResourceImportMetadata>( memnew( ResourceImportMetadata ) ) );
editor_data.get_edited_scene_import_metadata()->set_option("thumbnail",imgdata);
-
+#endif
//tamanio tel thumbnail
if (screen!=-1) {
_editor_select(screen);
@@ -1246,7 +1246,7 @@ void EditorNode::_dialog_action(String p_file) {
ml = Ref<MeshLibrary>( memnew( MeshLibrary ));
}
- MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true);
+// MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true);
Error err = ResourceSaver::save(p_file,ml);
if (err) {
@@ -1848,7 +1848,6 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
run_filename=scene->get_filename();
} else {
- args=run_settings_dialog->get_custom_arguments();
current_filename=scene->get_filename();
}
@@ -1923,9 +1922,14 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
log->clear();
}
+ if (bool(EDITOR_DEF("run/always_open_output_on_play", true))) {
+ make_bottom_panel_item_visible(log);
+ }
List<String> breakpoints;
editor_data.get_editor_breakpoints(&breakpoints);
+
+ args = Globals::get_singleton()->get("editor/main_run_args");
Error error = editor_run.run(run_filename,args,breakpoints,current_filename);
@@ -3275,7 +3279,7 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) {
OS::Time time = OS::get_singleton()->get_time();
f->store_line("# Translation Strings Dump.");
f->store_line("# Created By.");
- f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2016 Juan Linietsky, Ariel Manzur.");
+ f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2017 Juan Linietsky, Ariel Manzur.");
f->store_line("# From Scene: ");
f->store_line("# \t"+get_edited_scene()->get_filename());
f->store_line("");
@@ -5372,6 +5376,8 @@ void EditorNode::_bind_methods() {
EditorNode::EditorNode() {
+ VisualServer::get_singleton()->textures_keep_original(true);
+
EditorHelp::generate_doc(); //before any editor classes are crated
SceneState::set_disable_placeholders(true);
editor_initialize_certificates(); //for asset sharing
@@ -5458,7 +5464,7 @@ EditorNode::EditorNode() {
editor_import_export->load_config();
- GLOBAL_DEF("editor/main_run_args","$exec -path $path -scene $scene $main_scene");
+ GLOBAL_DEF("editor/main_run_args","$scene");
ObjectTypeDB::set_type_enabled("CollisionShape",true);
ObjectTypeDB::set_type_enabled("CollisionShape2D",true);
@@ -5672,6 +5678,7 @@ EditorNode::EditorNode() {
scene_root_parent->set_custom_minimum_size(Size2(0,80)*EDSCALE);
+
//Ref<StyleBox> sp = scene_root_parent->get_stylebox("panel","TabContainer");
//scene_root_parent->add_style_override("panel",sp);
@@ -5685,6 +5692,8 @@ EditorNode::EditorNode() {
scene_root = memnew( Viewport );
+ scene_root->set_disable_3d(true);
+
//scene_root_base->add_child(scene_root);
@@ -5692,7 +5701,7 @@ EditorNode::EditorNode() {
VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport(),true);
scene_root->set_disable_input(true);
scene_root->set_as_audio_listener_2d(true);
- scene_root->set_size_override(true,Size2(Globals::get_singleton()->get("display/width"),Globals::get_singleton()->get("display/height")));
+ //scene_root->set_size_override(true,Size2(Globals::get_singleton()->get("display/width"),Globals::get_singleton()->get("display/height")));
// scene_root->set_world_2d( Ref<World2D>( memnew( World2D )) );
@@ -5705,6 +5714,7 @@ EditorNode::EditorNode() {
scene_root_parent->add_child(viewport);
+
PanelContainer *top_region = memnew( PanelContainer );
top_region->add_style_override("panel",gui_base->get_stylebox("hover","Button"));
HBoxContainer *left_menu_hb = memnew( HBoxContainer );
@@ -5957,6 +5967,7 @@ EditorNode::EditorNode() {
debug_button->set_tooltip(TTR("Debug options"));
p=debug_button->get_popup();
+ p->set_hide_on_item_selection(false);
p->add_check_item(TTR("Deploy with Remote Debug"),RUN_DEPLOY_REMOTE_DEBUG);
p->set_item_tooltip(p->get_item_count()-1,TTR("When exporting or deploying, the resulting executable will attempt to connect to the IP of this computer in order to be debugged."));
p->add_check_item(TTR("Small Deploy with Network FS"),RUN_FILE_SERVER);
@@ -6421,7 +6432,7 @@ EditorNode::EditorNode() {
about->get_ok()->set_text(TTR("Thanks!"));
about->set_hide_on_ok(true);
Label *about_text = memnew( Label );
- about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2016 Juan Linietsky, Ariel Manzur.\n");
+ about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2017 Juan Linietsky, Ariel Manzur.\n");
about_text->set_pos(Point2(gui_base->get_icon("Logo","EditorIcons")->get_size().width+30,20));
gui_base->add_child(about);
about->add_child(about_text);
@@ -6549,10 +6560,11 @@ EditorNode::EditorNode() {
//more visually meaningful to have this later
raise_bottom_panel_item(AnimationPlayerEditor::singleton);
- add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,true) ) );
+ add_editor_plugin( memnew( ShaderEditorPlugin(this) ) );
+/* add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,true) ) );
add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,false) ) );
- add_editor_plugin( memnew( ShaderEditorPlugin(this,true) ) );
- add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) );
+
+ add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) );*/
add_editor_plugin( memnew( CameraEditorPlugin(this) ) );
add_editor_plugin( memnew( SampleEditorPlugin(this) ) );
add_editor_plugin( memnew( SampleLibraryEditorPlugin(this) ) );
@@ -6561,31 +6573,32 @@ EditorNode::EditorNode() {
add_editor_plugin( memnew( MeshInstanceEditorPlugin(this) ) );
add_editor_plugin( memnew( AnimationTreeEditorPlugin(this) ) );
//add_editor_plugin( memnew( SamplePlayerEditorPlugin(this) ) ); - this is kind of useless at this point
- add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) );
+// add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) );
//add_editor_plugin( memnew( StreamEditorPlugin(this) ) );
add_editor_plugin( memnew( StyleBoxEditorPlugin(this) ) );
- add_editor_plugin( memnew( ParticlesEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( ParticlesEditorPlugin(this) ) );
add_editor_plugin( memnew( ResourcePreloaderEditorPlugin(this) ) );
add_editor_plugin( memnew( ItemListEditorPlugin(this) ) );
//add_editor_plugin( memnew( RichTextEditorPlugin(this) ) );
- add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) );
+// add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) );
add_editor_plugin( memnew( CollisionPolygon2DEditorPlugin(this) ) );
add_editor_plugin( memnew( TileSetEditorPlugin(this) ) );
add_editor_plugin( memnew( TileMapEditorPlugin(this) ) );
add_editor_plugin( memnew( SpriteFramesEditorPlugin(this) ) );
add_editor_plugin( memnew( TextureRegionEditorPlugin(this) ) );
add_editor_plugin( memnew( Particles2DEditorPlugin(this) ) );
+ add_editor_plugin( memnew( GIProbeEditorPlugin(this) ) );
add_editor_plugin( memnew( Path2DEditorPlugin(this) ) );
- add_editor_plugin( memnew( PathEditorPlugin(this) ) );
- add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) );
+// add_editor_plugin( memnew( PathEditorPlugin(this) ) );
+ //add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) );
add_editor_plugin( memnew( Polygon2DEditorPlugin(this) ) );
add_editor_plugin( memnew( LightOccluder2DEditorPlugin(this) ) );
add_editor_plugin( memnew( NavigationPolygonEditorPlugin(this) ) );
add_editor_plugin( memnew( ColorRampEditorPlugin(this) ) );
add_editor_plugin( memnew( CollisionShape2DEditorPlugin(this) ) );
add_editor_plugin( memnew( TextureEditorPlugin(this) ) );
- add_editor_plugin( memnew( MaterialEditorPlugin(this) ) );
- add_editor_plugin( memnew( MeshEditorPlugin(this) ) );
+// add_editor_plugin( memnew( MaterialEditorPlugin(this) ) );
+// add_editor_plugin( memnew( MeshEditorPlugin(this) ) );
for(int i=0;i<EditorPlugins::get_plugin_count();i++)
add_editor_plugin( EditorPlugins::create(i,this) );
@@ -6594,14 +6607,14 @@ EditorNode::EditorNode() {
plugin_init_callbacks[i]();
}
- resource_preview->add_preview_generator( Ref<EditorTexturePreviewPlugin>( memnew(EditorTexturePreviewPlugin )));
+ /*resource_preview->add_preview_generator( Ref<EditorTexturePreviewPlugin>( memnew(EditorTexturePreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorPackedScenePreviewPlugin>( memnew(EditorPackedScenePreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorMaterialPreviewPlugin>( memnew(EditorMaterialPreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorScriptPreviewPlugin>( memnew(EditorScriptPreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorSamplePreviewPlugin>( memnew(EditorSamplePreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorMeshPreviewPlugin>( memnew(EditorMeshPreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorBitmapPreviewPlugin>( memnew(EditorBitmapPreviewPlugin )));
-
+*/
circle_step_msec=OS::get_singleton()->get_ticks_msec();
@@ -6684,6 +6697,7 @@ EditorNode::EditorNode() {
load_error_dialog->set_child_rect(load_errors);
gui_base->add_child(load_error_dialog);
+
//EditorImport::add_importer( Ref<EditorImporterCollada>( memnew(EditorImporterCollada )));
EditorFileSystem::get_singleton()->connect("sources_changed",this,"_sources_changed");