From 8be2fabbe5cd846bac5e5a38e55f3fb70e73f2da Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 27 May 2016 14:18:40 -0300 Subject: Changed import workflow -Rearrange favorites in fs dock with drag and drop -Removed import -> sub-scene, moved to scenetree contextual menu -Removed import -> re-import , moved and integrated to FS dock -Added ability in FS dock to re-import more than one resource simultaneously -Added ability to drag from native filesystem explorer to Godot, only works on Windows though -Removed scene reimport merge options, never worked well. Eventually merging materials should be re-added -Added ability to set custom root node type when importing scenes -Re-Import is now automatic, can be configured back to manual in editor settings -Added resource previews in property list for many resource types --- core/io/resource_loader.cpp | 1 + core/object.cpp | 7 + core/object.h | 2 + core/os/main_loop.cpp | 10 + core/os/main_loop.h | 2 + core/resource.cpp | 27 + core/resource.h | 4 + drivers/gles2/rasterizer_gles2.cpp | 7 +- drivers/gles2/rasterizer_gles2.h | 2 +- platform/windows/os_windows.cpp | 28 + scene/3d/mesh_instance.cpp | 87 ++- scene/3d/mesh_instance.h | 5 + scene/main/scene_main_loop.cpp | 10 + scene/main/scene_main_loop.h | 1 + scene/resources/mesh.cpp | 5 +- scene/scene_string_names.cpp | 7 + scene/scene_string_names.h | 6 + servers/visual/rasterizer.h | 1 + servers/visual/visual_server_raster.cpp | 33 +- servers/visual/visual_server_raster.h | 10 +- servers/visual/visual_server_wrap_mt.h | 2 + servers/visual_server.h | 2 + tools/editor/create_dialog.cpp | 9 + tools/editor/create_dialog.h | 1 + tools/editor/editor_file_system.cpp | 69 +++ tools/editor/editor_file_system.h | 8 +- tools/editor/editor_import_export.cpp | 31 +- tools/editor/editor_import_export.h | 3 + tools/editor/editor_node.cpp | 68 ++- tools/editor/editor_node.h | 5 + tools/editor/editor_resource_preview.cpp | 93 +++- tools/editor/editor_resource_preview.h | 5 +- tools/editor/editor_settings.cpp | 2 + tools/editor/icons/icon_dependency_changed.png | Bin 651 -> 649 bytes tools/editor/icons/icon_dependency_ok.png | Bin 685 -> 707 bytes .../io_plugins/editor_font_import_plugin.cpp | 21 + .../editor/io_plugins/editor_font_import_plugin.h | 1 + .../io_plugins/editor_mesh_import_plugin.cpp | 22 +- .../editor/io_plugins/editor_mesh_import_plugin.h | 1 + .../io_plugins/editor_sample_import_plugin.cpp | 53 ++ .../io_plugins/editor_sample_import_plugin.h | 3 + .../io_plugins/editor_scene_import_plugin.cpp | 584 +++++---------------- .../editor/io_plugins/editor_scene_import_plugin.h | 18 +- .../io_plugins/editor_texture_import_plugin.cpp | 374 +++++++++---- .../io_plugins/editor_texture_import_plugin.h | 14 +- .../editor_translation_import_plugin.cpp | 20 + .../io_plugins/editor_translation_import_plugin.h | 1 + tools/editor/plugins/mesh_editor_plugin.cpp | 16 + tools/editor/property_editor.cpp | 35 ++ tools/editor/property_editor.h | 2 + tools/editor/scene_tree_dock.cpp | 5 + tools/editor/scene_tree_dock.h | 1 + tools/editor/scenes_dock.cpp | 166 +++++- tools/editor/scenes_dock.h | 4 + 54 files changed, 1258 insertions(+), 636 deletions(-) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index abb1082256..b547dc0e85 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -243,6 +243,7 @@ Ref ResourceLoader::load_import_metadata(const String &p break; } + return ret; } diff --git a/core/object.cpp b/core/object.cpp index 3cfc0329bc..d7878fd623 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1756,6 +1756,7 @@ bool Object::is_queued_for_deletion() const { void Object::set_edited(bool p_edited) { _edited=p_edited; + _edited_version++; } bool Object::is_edited() const { @@ -1763,6 +1764,11 @@ bool Object::is_edited() const { return _edited; } + +uint32_t Object::get_edited_version() const { + + return _edited_version; +} #endif Object::Object() { @@ -1778,6 +1784,7 @@ Object::Object() { #ifdef TOOLS_ENABLED _edited=false; + _edited_version=0; #endif #ifdef DEBUG_ENABLED diff --git a/core/object.h b/core/object.h index 3945d1d0ba..4ed78d3226 100644 --- a/core/object.h +++ b/core/object.h @@ -388,6 +388,7 @@ friend void postinitialize_handler(Object*); bool _can_translate; #ifdef TOOLS_ENABLED bool _edited; + uint32_t _edited_version; #endif ScriptInstance *script_instance; RefPtr script; @@ -589,6 +590,7 @@ public: #ifdef TOOLS_ENABLED void set_edited(bool p_edited); bool is_edited() const; + uint32_t get_edited_version() const; //this function is used to check when something changed beyond a point, it's used mainly for generating previews #endif void set_script_instance(ScriptInstance *p_instance); diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 310bbaa3b8..e5feebfbfc 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -43,6 +43,7 @@ void MainLoop::_bind_methods() { BIND_VMETHOD( MethodInfo("_initialize") ); BIND_VMETHOD( MethodInfo("_iteration",PropertyInfo(Variant::REAL,"delta")) ); BIND_VMETHOD( MethodInfo("_idle",PropertyInfo(Variant::REAL,"delta")) ); + BIND_VMETHOD( MethodInfo("_drop_files",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::INT,"screen")) ); BIND_VMETHOD( MethodInfo("_finalize") ); BIND_CONSTANT(NOTIFICATION_WM_MOUSE_ENTER); @@ -108,6 +109,15 @@ bool MainLoop::idle(float p_time) { return false; } + +void MainLoop::drop_files(const Vector& p_files,int p_from_screen) { + + + if (get_script_instance()) + get_script_instance()->call("_drop_files",p_files,p_from_screen); + +} + void MainLoop::finish() { if (get_script_instance()) { diff --git a/core/os/main_loop.h b/core/os/main_loop.h index a34014983e..57185d9d3d 100644 --- a/core/os/main_loop.h +++ b/core/os/main_loop.h @@ -64,6 +64,8 @@ public: virtual bool idle(float p_time); virtual void finish(); + virtual void drop_files(const Vector& p_files,int p_from_screen=0); + void set_init_script(const Ref