From 96de0141ccef3bb035574010816dafdbfc17eb63 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 25 Jan 2017 21:55:59 -0300 Subject: [PATCH] Removed import/export system, will start new one from scratch. --- core/bind/core_bind.cpp | 5 - core/bind/core_bind.h | 1 - core/io/resource_format_binary.cpp | 97 ---------- core/io/resource_format_binary.h | 1 - core/io/resource_import.cpp | 154 +++++++++++++++ core/io/resource_import.h | 50 +++++ core/io/resource_loader.cpp | 145 +++----------- core/io/resource_loader.h | 9 +- core/path_remap.cpp | 182 ------------------ core/path_remap.h | 35 ---- core/register_core_types.cpp | 2 - core/resource.cpp | 130 ------------- core/resource.h | 46 ----- main/main.cpp | 11 +- modules/gdscript/register_types.cpp | 7 +- platform/android/export/export.cpp | 3 +- platform/bb10/export/export.cpp | 3 +- platform/javascript/export/export.cpp | 4 + platform/osx/export/export.cpp | 3 +- platform/uwp/export/export.cpp | 3 +- platform/windows/export/export.cpp | 3 +- platform/x11/export/export.cpp | 3 +- tools/editor/SCsub | 2 +- tools/editor/editor_data.cpp | 20 -- tools/editor/editor_data.h | 3 - tools/editor/editor_file_system.cpp | 6 +- tools/editor/editor_import_export.cpp | 2 + tools/editor/editor_import_export.h | 3 + tools/editor/editor_node.cpp | 86 ++------- tools/editor/editor_node.h | 9 +- tools/editor/editor_plugin.cpp | 27 --- tools/editor/editor_plugin.h | 6 - tools/editor/editor_reimport_dialog.cpp | 2 + tools/editor/editor_reimport_dialog.h | 2 + tools/editor/editor_run_native.cpp | 7 +- tools/editor/filesystem_dock.cpp | 17 +- .../editor_bitmask_import_plugin.cpp | 3 +- .../io_plugins/editor_bitmask_import_plugin.h | 3 +- .../editor/io_plugins/editor_export_scene.cpp | 3 +- tools/editor/io_plugins/editor_export_scene.h | 4 +- .../io_plugins/editor_font_import_plugin.cpp | 3 +- .../io_plugins/editor_font_import_plugin.h | 3 +- .../io_plugins/editor_import_collada.cpp | 2 + .../editor/io_plugins/editor_import_collada.h | 4 +- .../io_plugins/editor_mesh_import_plugin.cpp | 3 + .../io_plugins/editor_mesh_import_plugin.h | 3 +- .../io_plugins/editor_scene_import_plugin.cpp | 3 +- .../io_plugins/editor_scene_import_plugin.h | 4 +- .../editor_texture_import_plugin.cpp | 3 +- .../io_plugins/editor_texture_import_plugin.h | 2 + .../editor_translation_import_plugin.cpp | 3 + .../editor_translation_import_plugin.h | 3 +- tools/editor/project_export.cpp | 3 +- tools/editor/project_export.h | 2 + tools/editor/project_settings.cpp | 4 +- tools/editor/property_editor.cpp | 8 +- 56 files changed, 350 insertions(+), 805 deletions(-) create mode 100644 core/io/resource_import.cpp create mode 100644 core/io/resource_import.h diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 80adafe0927..5dbcfc86bc4 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -106,17 +106,12 @@ bool _ResourceLoader::has(const String &p_path) { return ResourceCache::has(local_path); }; -Ref _ResourceLoader::load_import_metadata(const String& p_path) { - - return ResourceLoader::load_import_metadata(p_path); -} void _ResourceLoader::_bind_methods() { ClassDB::bind_method(_MD("load_interactive:ResourceInteractiveLoader","path","type_hint"),&_ResourceLoader::load_interactive,DEFVAL("")); ClassDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false)); - ClassDB::bind_method(_MD("load_import_metadata:ResourceImportMetadata","path"),&_ResourceLoader::load_import_metadata); ClassDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type); ClassDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources); ClassDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 13081fc8678..00cbb254d62 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -54,7 +54,6 @@ public: void set_abort_on_missing_resources(bool p_abort); PoolStringArray get_dependencies(const String& p_path); bool has(const String& p_path); - Ref load_import_metadata(const String& p_path); _ResourceLoader(); }; diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 8f8fce08919..c75e4767644 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -759,30 +759,7 @@ Error ResourceInteractiveLoaderBinary::poll(){ resource_cache.push_back(res); if (main) { - if (importmd_ofs) { - f->seek(importmd_ofs); - Ref imd = memnew( ResourceImportMetadata ); - imd->set_editor(get_unicode_string()); - int sc = f->get_32(); - for(int i=0;iadd_source(src,md5); - } - int pc = f->get_32(); - - for(int i=0;iset_option(name,val); - } - res->set_import_metadata(imd); - - } f->close(); resource=res; error=ERR_FILE_EOF; @@ -849,9 +826,6 @@ void ResourceInteractiveLoaderBinary::get_dependencies(FileAccess *p_f,List& r_var) const { - - - FileAccess *f = FileAccess::open(p_path,FileAccess::READ); - if (!f) { - return ERR_FILE_CANT_OPEN; - } - - Ref ria = memnew( ResourceInteractiveLoaderBinary ); - ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); - ria->res_path=ria->local_path; - //ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); - ria->recognize(f); - if(ria->error!=OK) - return ERR_FILE_UNRECOGNIZED; - f=ria->f; - uint64_t imp_ofs = f->get_64(); - - if (imp_ofs==0) - return ERR_UNAVAILABLE; - - f->seek(imp_ofs); - Ref imd = memnew( ResourceImportMetadata ); - imd->set_editor(ria->get_unicode_string()); - int sc = f->get_32(); - for(int i=0;iget_unicode_string(); - String md5 = ria->get_unicode_string(); - imd->add_source(src,md5); - } - int pc = f->get_32(); - - for(int i=0;iget_unicode_string(); - Variant val; - ria->parse_variant(val); - imd->set_option(name,val); - } - - r_var=imd; - - return OK; - -} - void ResourceFormatLoaderBinary::get_dependencies(const String& p_path,List *p_dependencies,bool p_add_types) { @@ -2179,30 +2106,6 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ } f->seek_end(); - print_line("SAVING: "+p_path); - if (p_resource->get_import_metadata().is_valid()) { - uint64_t md_pos = f->get_pos(); - Ref imd=p_resource->get_import_metadata(); - save_unicode_string(imd->get_editor()); - f->store_32(imd->get_source_count()); - for(int i=0;iget_source_count();i++) { - save_unicode_string(imd->get_source_path(i)); - save_unicode_string(imd->get_source_md5(i)); - print_line("SAVE PATH: "+imd->get_source_path(i)); - print_line("SAVE MD5: "+imd->get_source_md5(i)); - } - List options; - imd->get_options(&options); - f->store_32(options.size()); - for(List::Element *E=options.front();E;E=E->next()) { - save_unicode_string(E->get()); - write_variant(imd->get_option(E->get())); - } - - f->seek(md_at); - f->store_64(md_pos); - f->seek_end(); - } f->store_buffer((const uint8_t*)"RSRC",4); //magic at end diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index 611029e792e..1dac51cc5c6 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -109,7 +109,6 @@ public: virtual bool handles_type(const String& p_type) const; virtual String get_resource_type(const String &p_path) const; virtual void get_dependencies(const String& p_path, List *p_dependencies, bool p_add_types=false); - virtual Error load_import_metadata(const String &p_path, Ref& r_var) const; virtual Error rename_dependencies(const String &p_path,const Map& p_map); diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp new file mode 100644 index 00000000000..92b5d1de408 --- /dev/null +++ b/core/io/resource_import.cpp @@ -0,0 +1,154 @@ +#include "resource_import.h" +#include "variant_parser.h" + +Error ResourceFormatImporter::_get_path_and_type(const String& p_path, PathAndType &r_path_and_type) const { + + Error err; + FileAccess *f= FileAccess::open(p_path+".import",FileAccess::READ,&err); + + if (!f) + return err; + + VariantParser::StreamFile stream; + stream.f=f; + + String assign; + Variant value; + VariantParser::Tag next_tag; + + int lines=0; + String error_text; + while(true) { + + assign=Variant(); + next_tag.fields.clear(); + next_tag.name=String(); + + err = VariantParser::parse_tag_assign_eof(&stream,lines,error_text,next_tag,assign,value,NULL,true); + if (err==ERR_FILE_EOF) { + memdelete(f); + return OK; + } + else if (err!=OK) { + ERR_PRINTS("ResourceFormatImporter::load - "+p_path+":"+itos(lines)+" error: "+error_text); + memdelete(f); + return err; + } + + if (assign!=String()) { + if (assign=="path") { + r_path_and_type.path=value; + } else if (assign=="type") { + r_path_and_type.type=value; + } + + } else if (next_tag.name!="remap") { + break; + } + } + + memdelete(f); + + if (r_path_and_type.path==String() || r_path_and_type.type==String()) { + return ERR_FILE_CORRUPT; + } + return OK; + +} + + +RES ResourceFormatImporter::load(const String &p_path,const String& p_original_path,Error *r_error) { + + PathAndType pat; + Error err = _get_path_and_type(p_path,pat); + + if (err!=OK) { + + if (r_error) + *r_error=err; + + return RES(); + } + + + return ResourceLoader::load(pat.path,pat.type,false,r_error); + +} + +void ResourceFormatImporter::get_recognized_extensions(List *p_extensions) const{ + + Set found; + + for (Set< Ref >::Element *E=importers.front();E;E=E->next()) { + List local_exts; + E->get()->get_recognized_extensions(&local_exts); + for (List::Element *F=local_exts.front();F;F=F->next()) { + if (!found.has(F->get())) { + p_extensions->push_back(F->get()); + found.insert(F->get()); + } + } + } +} + +void ResourceFormatImporter::get_recognized_extensions_for_type(const String& p_type,List *p_extensions) const{ + + Set found; + + for (Set< Ref >::Element *E=importers.front();E;E=E->next()) { + if (!ClassDB::is_parent_class(p_type,E->get()->get_resource_type())) + continue; + + List local_exts; + E->get()->get_recognized_extensions(&local_exts); + for (List::Element *F=local_exts.front();F;F=F->next()) { + if (!found.has(F->get())) { + p_extensions->push_back(F->get()); + found.insert(F->get()); + } + } + } +} + +bool ResourceFormatImporter::recognize_path(const String& p_path,const String& p_for_type) const{ + + return (p_path.get_extension().to_lower()=="import"); +} + +bool ResourceFormatImporter::handles_type(const String& p_type) const { + + for (Set< Ref >::Element *E=importers.front();E;E=E->next()) { + if (ClassDB::is_parent_class(p_type,E->get()->get_resource_type())) + return true; + + } + + return true; +} + +String ResourceFormatImporter::get_resource_type(const String &p_path) const { + + PathAndType pat; + Error err = _get_path_and_type(p_path,pat); + + if (err!=OK) { + + return ""; + } + + return pat.type; +} + +void ResourceFormatImporter::get_dependencies(const String& p_path,List *p_dependencies,bool p_add_types){ + + PathAndType pat; + Error err = _get_path_and_type(p_path,pat); + + if (err!=OK) { + + return; + } + + return ResourceLoader::get_dependencies(pat.path,p_dependencies,p_add_types); +} + diff --git a/core/io/resource_import.h b/core/io/resource_import.h new file mode 100644 index 00000000000..d4b80030b21 --- /dev/null +++ b/core/io/resource_import.h @@ -0,0 +1,50 @@ +#ifndef RESOURCE_IMPORT_H +#define RESOURCE_IMPORT_H + + +#include "io/resource_loader.h" +class ResourceImporter; + +class ResourceFormatImporter : public ResourceFormatLoader { + + struct PathAndType { + String path; + String type; + }; + + + Error _get_path_and_type(const String& p_path,PathAndType & r_path_and_type) const; + + Set< Ref > importers; +public: + + virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); + virtual void get_recognized_extensions(List *p_extensions) const; + virtual void get_recognized_extensions_for_type(const String& p_type,List *p_extensions) const; + bool recognize_path(const String& p_path,const String& p_for_type=String()) const; + virtual bool handles_type(const String& p_type) const=0; + virtual String get_resource_type(const String &p_path) const=0; + virtual void get_dependencies(const String& p_path,List *p_dependencies,bool p_add_types=false); + +}; + + +class ResourceImporter { +public: + virtual String get_name() const=0; + virtual String get_visible_name() const=0; + virtual void get_recognized_extensions(List *p_extensions) const=0; + virtual String get_resource_type() const=0; + + struct ImportOption { + PropertyInfo option; + Variant default_value; + }; + + virtual void get_import_options(List *r_options)=0; + + virtual RES import(const String& p_path,const Map& p_options)=0; + +}; + +#endif // RESOURCE_IMPORT_H diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 354efaa83f1..fbf6a2cea21 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -47,21 +47,29 @@ Error ResourceInteractiveLoader::wait() { return err; } +bool ResourceFormatLoader::recognize_path(const String& p_path,const String& p_for_type) const { -bool ResourceFormatLoader::recognize(const String& p_extension) const { + String extension = p_path.get_extension(); List extensions; - get_recognized_extensions(&extensions); + if (p_for_type==String()) { + get_recognized_extensions(&extensions); + } else { + get_recognized_extensions_for_type(p_for_type,&extensions); + } + for (List::Element *E=extensions.front();E;E=E->next()) { - if (E->get().nocasecmp_to(p_extension.get_extension())==0) + if (E->get().nocasecmp_to(extension)==0) return true; } return false; + } + void ResourceFormatLoader::get_recognized_extensions_for_type(const String& p_type,List *p_extensions) const { if (p_type=="" || handles_type(p_type)) @@ -166,7 +174,7 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p else local_path = GlobalConfig::get_singleton()->localize_path(p_path); - local_path=find_complete_path(local_path,p_type_hint); + ERR_FAIL_COND_V(local_path=="",RES()); if (!p_no_cache && ResourceCache::has(local_path)) { @@ -177,22 +185,16 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p return RES( ResourceCache::get(local_path ) ); } - String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - if (OS::get_singleton()->is_stdout_verbose()) - print_line("load resource: "+remapped_path); - - String extension=remapped_path.get_extension(); + print_line("load resource: "+local_path); bool found=false; for (int i=0;irecognize(extension)) - continue; - if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) + if (!loader[i]->recognize_path(local_path,p_type_hint)) continue; found=true; - RES res = loader[i]->load(remapped_path,local_path,r_error); + RES res = loader[i]->load(local_path,local_path,r_error); if (res.is_null()) continue; if (!p_no_cache) @@ -201,7 +203,7 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p res->set_edited(false); if (timestamp_on_load) { - uint64_t mt = FileAccess::get_modified_time(remapped_path); + uint64_t mt = FileAccess::get_modified_time(local_path); //printf("mt %s: %lli\n",remapped_path.utf8().get_data(),mt); res->set_last_modified_time(mt); } @@ -220,82 +222,6 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p } -Ref ResourceLoader::load_import_metadata(const String &p_path) { - - - - String local_path; - if (p_path.is_rel_path()) - local_path="res://"+p_path; - else - local_path = GlobalConfig::get_singleton()->localize_path(p_path); - - String extension=p_path.get_extension(); - Ref ret; - - for (int i=0;irecognize(extension)) - continue; - - Error err = loader[i]->load_import_metadata(local_path,ret); - if (err==OK) - break; - } - - - return ret; - -} - - - -String ResourceLoader::find_complete_path(const String& p_path,const String& p_type) { - //this is an old vestige when the engine saved files without extension. - //remains here for compatibility with old projects and only because it - //can be sometimes nice to open files using .* from a script and have it guess - //the right extension. - - String local_path = p_path; - if (local_path.ends_with("*")) { - - //find the extension for resource that ends with * - local_path = local_path.substr(0,local_path.length()-1); - List extensions; - get_recognized_extensions_for_type(p_type,&extensions); - List candidates; - - for(List::Element *E=extensions.front();E;E=E->next()) { - - String path = local_path+E->get(); - - if (PathRemap::get_singleton()->has_remap(path) || FileAccess::exists(path)) { - candidates.push_back(path); - } - - } - - - if (candidates.size()==0) { - return ""; - } else if (candidates.size()==1 || p_type=="") { - return candidates.front()->get(); - } else { - - for(List::Element *E=candidates.front();E;E=E->next()) { - - String rt = get_resource_type(E->get()); - if (ClassDB::is_parent_class(rt,p_type)) { - return E->get(); - } - } - - return ""; - } - } - - return local_path; -} Ref ResourceLoader::load_interactive(const String &p_path,const String& p_type_hint,bool p_no_cache,Error *r_error) { @@ -309,7 +235,7 @@ Ref ResourceLoader::load_interactive(const String &p_ else local_path = GlobalConfig::get_singleton()->localize_path(p_path); - local_path=find_complete_path(local_path,p_type_hint); + ERR_FAIL_COND_V(local_path=="",Ref()); @@ -329,19 +255,14 @@ Ref ResourceLoader::load_interactive(const String &p_ if (OS::get_singleton()->is_stdout_verbose()) print_line("load resource: "); - String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - - String extension=remapped_path.get_extension(); bool found=false; for (int i=0;irecognize(extension)) - continue; - if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) + if (!loader[i]->recognize_path(local_path,p_type_hint)) continue; found=true; - Ref ril = loader[i]->load_interactive(remapped_path,r_error); + Ref ril = loader[i]->load_interactive(local_path,r_error); if (ril.is_null()) continue; if (!p_no_cache) @@ -383,20 +304,16 @@ void ResourceLoader::get_dependencies(const String& p_path, List *p_depe else local_path = GlobalConfig::get_singleton()->localize_path(p_path); - String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - - String extension=remapped_path.get_extension(); - for (int i=0;irecognize(extension)) + if (!loader[i]->recognize_path(local_path)) continue; /* if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) continue; */ - loader[i]->get_dependencies(remapped_path,p_dependencies,p_add_types); + loader[i]->get_dependencies(local_path,p_dependencies,p_add_types); } } @@ -410,20 +327,17 @@ Error ResourceLoader::rename_dependencies(const String &p_path,const Maplocalize_path(p_path); - String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - - String extension=remapped_path.get_extension(); for (int i=0;irecognize(extension)) + if (!loader[i]->recognize_path(local_path)) continue; /* if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) continue; */ - return loader[i]->rename_dependencies(p_path,p_map); + return loader[i]->rename_dependencies(local_path,p_map); } @@ -432,17 +346,6 @@ Error ResourceLoader::rename_dependencies(const String &p_path,const Maplocalize_path(p_path); - - return find_complete_path(local_path,p_type); - -} String ResourceLoader::get_resource_type(const String &p_path) { @@ -452,8 +355,6 @@ String ResourceLoader::get_resource_type(const String &p_path) { else local_path = GlobalConfig::get_singleton()->localize_path(p_path); - String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.get_extension(); for (int i=0;i *p_extensions) const=0; virtual void get_recognized_extensions_for_type(const String& p_type,List *p_extensions) const; - bool recognize(const String& p_extension) const; + bool recognize_path(const String& p_path,const String& p_for_type=String()) const; virtual bool handles_type(const String& p_type) const=0; virtual String get_resource_type(const String &p_path) const=0; virtual void get_dependencies(const String& p_path,List *p_dependencies,bool p_add_types=false); - virtual Error load_import_metadata(const String &p_path, Ref& r_var) const { return ERR_UNAVAILABLE; } virtual Error rename_dependencies(const String &p_path,const Map& p_map) { return OK; } virtual ~ResourceFormatLoader() {} @@ -92,14 +91,12 @@ class ResourceLoader { static DependencyErrorNotify dep_err_notify; static bool abort_on_missing_resource; - static String find_complete_path(const String& p_path,const String& p_type); public: static Ref load_interactive(const String &p_path,const String& p_type_hint="",bool p_no_cache=false,Error *r_error=NULL); static RES load(const String &p_path,const String& p_type_hint="",bool p_no_cache=false,Error *r_error=NULL); - static Ref load_import_metadata(const String &p_path); static void get_recognized_extensions_for_type(const String& p_type,List *p_extensions); static void add_resource_format_loader(ResourceFormatLoader *p_format_loader,bool p_at_front=false); @@ -107,8 +104,6 @@ public: static void get_dependencies(const String& p_path,List *p_dependencies,bool p_add_types=false); static Error rename_dependencies(const String &p_path,const Map& p_map); - static String guess_full_filename(const String &p_path,const String& p_type); - static void set_timestamp_on_load(bool p_timestamp) { timestamp_on_load=p_timestamp; } static void notify_load_error(const String& p_err) { if (err_notify) err_notify(err_notify_ud,p_err); } @@ -122,4 +117,6 @@ public: static bool get_abort_on_missing_resources() { return abort_on_missing_resource; } }; + + #endif diff --git a/core/path_remap.cpp b/core/path_remap.cpp index ed77fd88409..bbaba71bba7 100644 --- a/core/path_remap.cpp +++ b/core/path_remap.cpp @@ -28,185 +28,3 @@ /*************************************************************************/ #include "path_remap.h" -#include "globals.h" -#include "os/os.h" -#include "translation.h" - -PathRemap* PathRemap::singleton=NULL; - -PathRemap* PathRemap::get_singleton() { - - return singleton; -} - -void PathRemap::add_remap(const String& p_from, const String& p_to,const String& p_locale) { - - if (!remap.has(p_from)) { - remap[p_from]=RemapData(); - } - - if (p_locale==String()) - remap[p_from].always=p_to; - else - remap[p_from].locale[p_locale]=p_to; -} - - -String PathRemap::get_remap(const String& p_from) const { - - const RemapData *ptr=remap.getptr(p_from); - if (!ptr) { - if (OS::get_singleton()->is_stdout_verbose()) - print_line("remap failed: "+p_from); - return p_from; - } else { - - const RemapData *ptr2=NULL; - - String locale = TranslationServer::get_singleton()->get_locale(); - - if (ptr->locale.has(locale)) { - if (OS::get_singleton()->is_stdout_verbose()) - print_line("remap found: "+p_from+" -> "+ptr->locale[locale]); - - ptr2=remap.getptr(ptr->locale[locale]); - - if (ptr2 && ptr2->always!=String()) //may have atlas or export remap too - return ptr2->always; - else - return ptr->locale[locale]; - } - - int p = locale.find("_"); - if (p!=-1) { - locale=locale.substr(0,p); - if (ptr->locale.has(locale)) { - if (OS::get_singleton()->is_stdout_verbose()) - print_line("remap found: "+p_from+" -> "+ptr->locale[locale]); - - ptr2=remap.getptr(ptr->locale[locale]); - - if (ptr2 && ptr2->always!=String()) //may have atlas or export remap too - return ptr2->always; - else - return ptr->locale[locale]; - - } - } - - if (ptr->always!=String()) { - if (OS::get_singleton()->is_stdout_verbose()) { - print_line("remap found: "+p_from+" -> "+ptr->always); - } - return ptr->always; - } - - if (OS::get_singleton()->is_stdout_verbose()) - print_line("remap failed: "+p_from); - - return p_from; - } -} -bool PathRemap::has_remap(const String& p_from) const{ - - return remap.has(p_from); -} - -void PathRemap::erase_remap(const String& p_from){ - - ERR_FAIL_COND(!remap.has(p_from)); - remap.erase(p_from); -} - -void PathRemap::clear_remaps() { - - remap.clear(); -} - -void PathRemap::load_remaps() { - - // default remaps first - PoolVector remaps; - if (GlobalConfig::get_singleton()->has("remap/all")) { - remaps = GlobalConfig::get_singleton()->get("remap/all"); - } - - { - int rlen = remaps.size(); - - ERR_FAIL_COND( rlen%2 ); - PoolVector::Read r = remaps.read(); - for(int i=0;ihas("remap/"+OS::get_singleton()->get_name())) { - remaps = GlobalConfig::get_singleton()->get("remap/"+OS::get_singleton()->get_name()); - } else { - remaps.resize(0); - } - //remaps = Globals::get_singleton()->get("remap/PSP"); - { - int rlen = remaps.size(); - - ERR_FAIL_COND( rlen%2 ); - PoolVector::Read r = remaps.read(); - for(int i=0;i "+to); - add_remap(from,to); - } - } - - - //locale based remaps - - if (GlobalConfig::get_singleton()->has("locale/translation_remaps")) { - - Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps"); - List rk; - remaps.get_key_list(&rk); - for(List::Element *E=rk.front();E;E=E->next()) { - - String source = E->get(); - PoolStringArray sa = remaps[E->get()]; - int sas = sa.size(); - PoolStringArray::Read r = sa.read(); - - for(int i=0;i locale; - }; - - HashMap remap; -protected: - - static void _bind_methods(); -public: - - void add_remap(const String& p_from, const String& p_to,const String& p_locale=String()); - bool has_remap(const String& p_from) const; - //_FORCE_INLINE_ String get_remap(const String& p_from) const { const String *ptr=remap.getptr(p_from); if (!ptr) return p_from; else return *ptr; } - String get_remap(const String& p_from) const; - void erase_remap(const String& p_from); - void clear_remaps(); - - void load_remaps(); - - static PathRemap* get_singleton(); - - PathRemap(); -}; - #endif // PATH_REMAP_H diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 242d36042df..8cbfdf0b014 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -110,7 +110,6 @@ void register_core_types() { ClassDB::register_class(); ClassDB::register_class(); - ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_virtual_class(); @@ -179,7 +178,6 @@ void register_core_singletons() { GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("Geometry",_Geometry::get_singleton()) ); GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("ResourceLoader",_ResourceLoader::get_singleton()) ); GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("ResourceSaver",_ResourceSaver::get_singleton()) ); - GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("PathRemap",PathRemap::get_singleton() ) ); GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("OS",_OS::get_singleton() ) ); GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("Engine",_Engine::get_singleton() ) ); GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("ClassDB",_classdb ) ); diff --git a/core/resource.cpp b/core/resource.cpp index 6e8d9a8b174..765000d662a 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -35,119 +35,6 @@ #include -void ResourceImportMetadata::set_editor(const String& p_editor) { - - editor=p_editor; -} - -String ResourceImportMetadata::get_editor() const{ - - return editor; -} - -void ResourceImportMetadata::add_source(const String& p_path,const String& p_md5) { - - Source s; - s.md5=p_md5; - s.path=p_path; - sources.push_back(s); -} - -String ResourceImportMetadata::get_source_path(int p_idx) const{ - ERR_FAIL_INDEX_V(p_idx,sources.size(),String()); - return sources[p_idx].path; -} -String ResourceImportMetadata::get_source_md5(int p_idx) const{ - ERR_FAIL_INDEX_V(p_idx,sources.size(),String()); - return sources[p_idx].md5; -} - -void ResourceImportMetadata::set_source_md5(int p_idx,const String& p_md5) { - - ERR_FAIL_INDEX(p_idx,sources.size()); - sources[p_idx].md5=p_md5; - -} - -void ResourceImportMetadata::remove_source(int p_idx){ - - ERR_FAIL_INDEX(p_idx,sources.size()); - sources.remove(p_idx); - -} - -int ResourceImportMetadata::get_source_count() const { - - return sources.size(); -} -void ResourceImportMetadata::set_option(const String& p_key, const Variant& p_value) { - - if (p_value.get_type()==Variant::NIL) { - options.erase(p_key); - return; - } - - ERR_FAIL_COND(p_value.get_type() == Variant::OBJECT); - ERR_FAIL_COND(p_value.get_type() == Variant::_RID); - - options[p_key]=p_value; - -} - -bool ResourceImportMetadata::has_option(const String& p_key) const { - - return options.has(p_key); -} - -Variant ResourceImportMetadata::get_option(const String& p_key) const { - - ERR_FAIL_COND_V(!options.has(p_key),Variant()); - - return options[p_key]; -} - -void ResourceImportMetadata::get_options(List *r_options) const { - - for(Map::Element *E=options.front();E;E=E->next()) { - - r_options->push_back(E->key()); - } - -} - -PoolStringArray ResourceImportMetadata::_get_options() const { - - PoolStringArray option_names; - option_names.resize(options.size()); - int i=0; - for(Map::Element *E=options.front();E;E=E->next()) { - - option_names.set(i++,E->key()); - } - - return option_names; -} - -void ResourceImportMetadata::_bind_methods() { - - ClassDB::bind_method(_MD("set_editor","name"),&ResourceImportMetadata::set_editor); - ClassDB::bind_method(_MD("get_editor"),&ResourceImportMetadata::get_editor); - ClassDB::bind_method(_MD("add_source","path","md5"),&ResourceImportMetadata::add_source, ""); - ClassDB::bind_method(_MD("get_source_path","idx"),&ResourceImportMetadata::get_source_path); - ClassDB::bind_method(_MD("get_source_md5","idx"),&ResourceImportMetadata::get_source_md5); - ClassDB::bind_method(_MD("set_source_md5","idx", "md5"),&ResourceImportMetadata::set_source_md5); - ClassDB::bind_method(_MD("remove_source","idx"),&ResourceImportMetadata::remove_source); - ClassDB::bind_method(_MD("get_source_count"),&ResourceImportMetadata::get_source_count); - ClassDB::bind_method(_MD("set_option","key","value"),&ResourceImportMetadata::set_option); - ClassDB::bind_method(_MD("get_option","key"),&ResourceImportMetadata::get_option); - ClassDB::bind_method(_MD("get_options"),&ResourceImportMetadata::_get_options); -} - -ResourceImportMetadata::ResourceImportMetadata() { - - -} - void Resource::emit_changed() { @@ -381,21 +268,6 @@ void Resource::notify_change_to_owners() { } } -void Resource::set_import_metadata(const Ref& p_metadata) { -#ifdef TOOLS_ENABLED - import_metadata=p_metadata; -#endif -} - -Ref Resource::get_import_metadata() const { - -#ifdef TOOLS_ENABLED - return import_metadata; -#else - return Ref(); -#endif - -} #ifdef TOOLS_ENABLED @@ -461,8 +333,6 @@ void Resource::_bind_methods() { ClassDB::bind_method(_MD("set_name","name"),&Resource::set_name); ClassDB::bind_method(_MD("get_name"),&Resource::get_name); ClassDB::bind_method(_MD("get_rid"),&Resource::get_rid); - ClassDB::bind_method(_MD("set_import_metadata","metadata"),&Resource::set_import_metadata); - ClassDB::bind_method(_MD("get_import_metadata"),&Resource::get_import_metadata); ClassDB::bind_method(_MD("set_local_to_scene","enable"),&Resource::set_local_to_scene); ClassDB::bind_method(_MD("is_local_to_scene"),&Resource::is_local_to_scene); ClassDB::bind_method(_MD("get_local_scene:Node"),&Resource::get_local_scene); diff --git a/core/resource.h b/core/resource.h index 2b071c8e1c4..b2873e48666 100644 --- a/core/resource.h +++ b/core/resource.h @@ -46,47 +46,6 @@ virtual String get_base_extension() const { return m_ext; }\ private: -class ResourceImportMetadata : public Reference { - - GDCLASS( ResourceImportMetadata, Reference ); - - struct Source { - String path; - String md5; - }; - - Vector sources; - String editor; - - Map options; - - PoolStringArray _get_options() const; - -protected: - - static void _bind_methods(); -public: - - void set_editor(const String& p_editor); - String get_editor() const; - - void add_source(const String& p_path,const String& p_md5=""); - String get_source_path(int p_idx) const; - String get_source_md5(int p_idx) const; - void set_source_md5(int p_idx,const String& p_md5); - void remove_source(int p_idx); - int get_source_count() const; - - void set_option(const String& p_key, const Variant& p_value); - Variant get_option(const String& p_key) const; - bool has_option(const String& p_key) const; - - void get_options(List *r_options) const; - - - ResourceImportMetadata(); -}; - class Resource : public Reference { @@ -106,7 +65,6 @@ friend class ResourceCache; virtual bool _use_builtin_script() const { return true; } #ifdef TOOLS_ENABLED - Ref import_metadata; uint64_t last_modified_time; #endif @@ -147,10 +105,6 @@ public: Ref duplicate(bool p_subresources=false); Ref duplicate_for_local_scene(Node *p_scene,Map,Ref >& remap_cache); - - void set_import_metadata(const Ref& p_metadata); - Ref get_import_metadata() const; - void set_local_to_scene(bool p_enable); bool is_local_to_scene() const; virtual void setup_local_to_scene(); diff --git a/main/main.cpp b/main/main.cpp index 22223fe2c47..6dde1e521ca 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -38,7 +38,7 @@ #include "script_debugger_local.h" #include "script_debugger_remote.h" #include "message_queue.h" -#include "path_remap.h" + #include "input_map.h" #include "io/resource_loader.h" #include "scene/main/scene_main_loop.h" @@ -85,7 +85,7 @@ AudioServer *audio_server=NULL; static MessageQueue *message_queue=NULL; static Performance *performance = NULL; -static PathRemap *path_remap; + static PackedData *packed_data=NULL; #ifdef MINIZIP_ENABLED static ZipArchive *zip_packed_data=NULL; @@ -215,7 +215,6 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas register_core_settings(); //here globals is present - path_remap = memnew( PathRemap ); translation_server = memnew( TranslationServer ); performance = memnew( Performance ); globals->add_singleton(GlobalConfig::Singleton("Performance",performance)); @@ -874,8 +873,6 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas memdelete(packed_data); if (file_access_network_client) memdelete(file_access_network_client); - if(path_remap) - memdelete(path_remap); // Note 1: *zip_packed_data live into *packed_data // Note 2: PackedData::~PackedData destroy this. @@ -935,8 +932,6 @@ Error Main::setup2() { } MAIN_PRINT("Main: Load Remaps"); - path_remap->load_remaps(); - Color clear = GLOBAL_DEF("rendering/viewport/default_clear_color",Color(0.3,0.3,0.3)); VisualServer::get_singleton()->set_default_clear_color(clear); @@ -1791,8 +1786,6 @@ void Main::cleanup() { memdelete(input_map); if (translation_server) memdelete( translation_server ); - if (path_remap) - memdelete(path_remap); if (globals) memdelete(globals); if (engine) diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 051d1d85cdf..db47ee43ce6 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -38,7 +38,7 @@ GDScriptLanguage *script_language_gd=NULL; ResourceFormatLoaderGDScript *resource_loader_gd=NULL; ResourceFormatSaverGDScript *resource_saver_gd=NULL; - +#if 0 #ifdef TOOLS_ENABLED #include "tools/editor/editor_import_export.h" @@ -135,7 +135,7 @@ static void register_editor_plugin() { #endif - +#endif void register_gdscript_types() { ClassDB::register_class(); @@ -148,11 +148,12 @@ void register_gdscript_types() { ResourceLoader::add_resource_format_loader(resource_loader_gd); resource_saver_gd=memnew( ResourceFormatSaverGDScript ); ResourceSaver::add_resource_format_saver(resource_saver_gd); - +#if 0 #ifdef TOOLS_ENABLED EditorNode::add_init_callback(register_editor_plugin); #endif +#endif } void unregister_gdscript_types() { diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 33283eccea5..8e1fda74edf 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -38,7 +38,7 @@ #include "os/os.h" #include "platform/android/logo.h" #include - +#if 0 static const char* android_perms[]={ "ACCESS_CHECKIN_PROPERTIES", @@ -1915,3 +1915,4 @@ void register_android_exporter() { EditorImportExport::get_singleton()->add_export_platform(exporter); } +#endif diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index cc994c8f24e..3e6dadb0949 100644 --- a/platform/bb10/export/export.cpp +++ b/platform/bb10/export/export.cpp @@ -40,7 +40,7 @@ #include "io/xml_parser.h" #define MAX_DEVICES 5 - +#if 0 class EditorExportPlatformBB10 : public EditorExportPlatform { GDCLASS( EditorExportPlatformBB10,EditorExportPlatform ); @@ -827,3 +827,4 @@ void register_bb10_exporter() { } +#endif diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index e0ff9932ccd..ab3d159f346 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -38,6 +38,9 @@ #include "os/os.h" #include "platform/javascript/logo.h" #include "string.h" + + +#if 0 class EditorExportPlatformJavaScript : public EditorExportPlatform { GDCLASS( EditorExportPlatformJavaScript,EditorExportPlatform ); @@ -424,3 +427,4 @@ void register_javascript_exporter() { } +#endif diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 1cb41cede21..3a97827c165 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -39,7 +39,7 @@ #include "os/os.h" #include "platform/osx/logo.h" #include "string.h" - +#if 0 class EditorExportPlatformOSX : public EditorExportPlatform { @@ -546,3 +546,4 @@ void register_osx_exporter() { } +#endif diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index f31c91ef6d4..167a5831cf2 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -65,7 +65,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************/ - +#if 0 #include "version.h" #include "export.h" #include "object.h" @@ -2390,3 +2390,4 @@ void register_uwp_exporter() { Ref exporter = Ref(memnew(EditorExportPlatformUWP)); EditorImportExport::get_singleton()->add_export_platform(exporter); } +#endif diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 1ad61844d05..88d534887b1 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -29,7 +29,7 @@ #include "export.h" #include "platform/windows/logo.h" #include "tools/editor/editor_import_export.h" - +#if 0 void register_windows_exporter() { Image img(_windows_logo); @@ -50,3 +50,4 @@ void register_windows_exporter() { } +#endif diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp index c1af323453a..5a4751b3879 100644 --- a/platform/x11/export/export.cpp +++ b/platform/x11/export/export.cpp @@ -30,7 +30,7 @@ #include "platform/x11/logo.h" #include "tools/editor/editor_import_export.h" #include "scene/resources/texture.h" - +#if 0 void register_x11_exporter() { Image img(_x11_logo); @@ -50,3 +50,4 @@ void register_x11_exporter() { } } +#endif diff --git a/tools/editor/SCsub b/tools/editor/SCsub index caf45d25be5..85d4d11073c 100644 --- a/tools/editor/SCsub +++ b/tools/editor/SCsub @@ -55,7 +55,7 @@ if (env["tools"] == "yes"): reg_exporters = 'void register_exporters() {\n' for e in env.platform_exporters: env.tool_sources.append("#platform/" + e + "/export/export.cpp") - reg_exporters += '\tregister_' + e + '_exporter();\n' + reg_exporters += '\t//register_' + e + '_exporter();\n' reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n' reg_exporters += '}\n' f = open("register_exporters.cpp", "wb") diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index 44de1836b6e..ef839d7e74f 100644 --- a/tools/editor/editor_data.cpp +++ b/tools/editor/editor_data.cpp @@ -769,26 +769,6 @@ Dictionary EditorData::restore_edited_scene_state(EditorSelection *p_selection, } -void EditorData::set_edited_scene_import_metadata(Ref p_mdata) { - - ERR_FAIL_INDEX(current_edited_scene,edited_scene.size()); - edited_scene[current_edited_scene].medatata=p_mdata; - -} - -Ref EditorData::get_edited_scene_import_metadata(int idx) const{ - - ERR_FAIL_INDEX_V(current_edited_scene,edited_scene.size(),Ref()); - if(idx<0) { - return edited_scene[current_edited_scene].medatata; - } else { - ERR_FAIL_INDEX_V(idx,edited_scene.size(),Ref()); - return edited_scene[idx].medatata; - } -} - - - void EditorData::clear_edited_scenes() { for(int i=0;i medatata; List selection; Vector history_stored; int history_current; @@ -184,8 +183,6 @@ public: void remove_scene(int p_idx); void set_edited_scene(int p_idx); void set_edited_scene_root(Node* p_root); - void set_edited_scene_import_metadata(Ref p_mdata); - Ref get_edited_scene_import_metadata(int p_idx = -1) const; int get_edited_scene() const; Node* get_edited_scene_root(int p_idx = -1); int get_edited_scene_count() const; diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp index 39869beef41..120cbb97122 100644 --- a/tools/editor/editor_file_system.cpp +++ b/tools/editor/editor_file_system.cpp @@ -247,6 +247,8 @@ EditorFileSystemDirectory::~EditorFileSystemDirectory() { EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String& p_path) { + return EditorFileSystemDirectory::ImportMeta(); +#if 0 Ref imd = ResourceLoader::load_import_metadata(p_path); EditorFileSystemDirectory::ImportMeta m; if (imd.is_null()) { @@ -274,6 +276,7 @@ EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String& } return m; +#endif } @@ -535,7 +538,7 @@ bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta for(int j=0;jexport_platform(export_defer.platform,export_defer.path,export_defer.debug,export_defer.password,true); + //project_export_settings->export_platform(export_defer.platform,export_defer.path,export_defer.debug,export_defer.password,true); export_defer.platform=""; } @@ -448,7 +448,7 @@ void EditorNode::_sources_changed(bool p_exist) { EditorProgress ep("reimport",TTR("Re-Importing"),changed_sources.size()); int step_idx=0; - +#if 0 for(List::Element *E=changed_sources.front();E;E=E->next()) { ep.step(TTR("Importing:")+" "+E->get(),step_idx++); @@ -467,7 +467,7 @@ void EditorNode::_sources_changed(bool p_exist) { } } - +#endif EditorFileSystem::get_singleton()->scan_sources(); waiting_for_sources_changed=false; @@ -502,9 +502,11 @@ void EditorNode::_rebuild_import_menu() p->clear(); //p->add_item(TTR("Node From Scene"), FILE_IMPORT_SUBSCENE); //p->add_separator(); +#if 0 for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) { p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i); } +#endif } void EditorNode::_node_renamed() { @@ -1008,7 +1010,6 @@ void EditorNode::_save_scene(String p_file, int idx) { return; } - sdata->set_import_metadata(editor_data.get_edited_scene_import_metadata(idx)); int flg=0; if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg|=ResourceSaver::FLAG_COMPRESS; @@ -2282,7 +2283,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { case FILE_EXPORT_PROJECT: { - project_export_settings->popup_export(); + //project_export_settings->popup_export(); /* String target = export_db->get_current_platform(); Ref exporter = export_db->get_exporter(target); @@ -2861,7 +2862,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; case SOURCES_REIMPORT: { - reimport_dialog->popup_reimport(); + //reimport_dialog->popup_reimport(); } break; case DEPENDENCY_LOAD_CHANGED_IMAGES: { @@ -2951,10 +2952,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { current->call(name); } else if (p_option>=IMPORT_PLUGIN_BASE) { - Ref p = editor_import_export->get_import_plugin(p_option-IMPORT_PLUGIN_BASE); - if (p.is_valid()) { - p->import_dialog(); - } } } @@ -3055,20 +3052,6 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor) { } -void EditorNode::add_editor_import_plugin(const Ref& p_editor_import) { - - ERR_FAIL_COND( p_editor_import.is_null() ); - editor_import_export->add_import_plugin(p_editor_import); - _rebuild_import_menu(); -} - -void EditorNode::remove_editor_import_plugin(const Ref& p_editor_import) { - ERR_FAIL_COND( p_editor_import.is_null() ); - - editor_import_export->remove_import_plugin(p_editor_import); - _rebuild_import_menu(); -} - void EditorNode::_update_addon_config() { @@ -3812,7 +3795,6 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo property_editor->edit(new_scene); editor_data.set_edited_scene_root(new_scene); */ - editor_data.set_edited_scene_import_metadata( sdata->get_import_metadata() ); //editor_data.get_undo_redo().clear_history(); saved_version=editor_data.get_undo_redo().get_version(); @@ -4155,9 +4137,9 @@ bool EditorNode::is_scene_in_use(const String& p_path) { void EditorNode::register_editor_types() { ClassDB::register_class(); - ClassDB::register_class(); - ClassDB::register_class(); - ClassDB::register_class(); +// ClassDB::register_class(); +// ClassDB::register_class(); +// ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); @@ -5187,9 +5169,9 @@ Variant EditorNode::drag_files_and_dirs(const Vector& p_files, Control * void EditorNode::_dropped_files(const Vector& p_files,int p_screen) { String cur_path = filesystem_dock->get_current_path(); - for(int i=0;iget_import_plugin_count();i++) { - EditorImportExport::get_singleton()->get_import_plugin(i)->import_from_drop(p_files,cur_path); - } +// for(int i=0;iget_import_plugin_count();i++) { +// EditorImportExport::get_singleton()->get_import_plugin(i)->import_from_drop(p_files,cur_path); +// } } void EditorNode::_file_access_close_error_notify(const String& p_str) { @@ -5369,8 +5351,8 @@ void EditorNode::_bind_methods() { - ClassDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin); - ClassDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin); +// ClassDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin); + //ClassDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin); ClassDB::bind_method(_MD("get_gui_base"), &EditorNode::get_gui_base); ClassDB::bind_method(_MD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch); @@ -5423,7 +5405,6 @@ EditorNode::EditorNode() { FileAccess::set_backup_save(true); - PathRemap::get_singleton()->clear_remaps(); //editor uses no remaps TranslationServer::get_singleton()->set_enabled(false); // load settings if (!EditorSettings::get_singleton()) @@ -5476,13 +5457,8 @@ EditorNode::EditorNode() { EditorFileDialog::unregister_func=_editor_file_dialog_unregister; - editor_import_export = memnew( EditorImportExport ); - add_child(editor_import_export); - register_exporters(); - editor_import_export->load_config(); - GLOBAL_DEF("editor/main_run_args","$scene"); ClassDB::set_class_enabled("CollisionShape",true); @@ -6396,11 +6372,11 @@ EditorNode::EditorNode() { //gui_base->add_child(optimized_save); //optimized_save->connect("confirmed",this,"_save_optimized"); - project_export = memnew( ProjectExport(&editor_data) ); - gui_base->add_child(project_export); + //project_export = memnew( ProjectExport(&editor_data) ); + //gui_base->add_child(project_export); - project_export_settings = memnew( ProjectExportDialog(this) ); - gui_base->add_child(project_export_settings); + //project_export_settings = memnew( ProjectExportDialog(this) ); + //gui_base->add_child(project_export_settings); //optimized_presets = memnew( OptimizedPresetsDialog(&editor_data) ); //gui_base->add_child(optimized_presets); @@ -6514,8 +6490,8 @@ EditorNode::EditorNode() { gui_base->add_child(file_script); file_script->connect("file_selected",this,"_dialog_action"); - reimport_dialog = memnew( EditorReImportDialog ); - gui_base->add_child(reimport_dialog); + //reimport_dialog = memnew( EditorReImportDialog ); + //gui_base->add_child(reimport_dialog); @@ -6541,26 +6517,6 @@ EditorNode::EditorNode() { file_server = memnew( EditorFileServer ); - editor_import_export->add_import_plugin( Ref( memnew(EditorTextureImportPlugin(this) ))); - Ref _scene_import = memnew(EditorSceneImportPlugin(this) ); - Ref _collada_import = memnew( EditorSceneImporterCollada); - _scene_import->add_importer(_collada_import); - //Ref _fbxconv_import = memnew( EditorSceneImporterFBXConv); - //_scene_import->add_importer(_fbxconv_import); - editor_import_export->add_import_plugin( _scene_import); - // TODO: This plugin has no code, it should be either implemented or dropped (GH-3667) - // editor_import_export->add_import_plugin( Ref( memnew(EditorSceneAnimationImportPlugin(this)))); - editor_import_export->add_import_plugin( Ref( memnew(EditorMeshImportPlugin(this)))); - editor_import_export->add_import_plugin( Ref( memnew(EditorFontImportPlugin(this)))); -// editor_import_export->add_import_plugin( Ref( memnew(EditorSampleImportPlugin(this)))); - editor_import_export->add_import_plugin( Ref( memnew(EditorTranslationImportPlugin(this)))); - editor_import_export->add_import_plugin( Ref( memnew(EditorBitMaskImportPlugin(this)))); - - - editor_import_export->add_export_plugin( Ref( memnew(EditorTextureExportPlugin))); -// editor_import_export->add_export_plugin( Ref( memnew(EditorSampleExportPlugin))); - editor_import_export->add_export_plugin( Ref( memnew(EditorSceneExportPlugin))); - add_editor_plugin( memnew( AnimationPlayerEditorPlugin(this) ) ); add_editor_plugin( memnew( CanvasItemEditorPlugin(this) ) ); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index fbba7ae7a91..faf11f5d20d 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -340,7 +340,7 @@ private: Vector main_editor_buttons; Vector editor_table; - EditorReImportDialog *reimport_dialog; +// EditorReImportDialog *reimport_dialog; ProgressDialog *progress_dialog; BackgroundProgress *progress_hb; @@ -391,8 +391,8 @@ private: EditorData editor_data; EditorRun editor_run; EditorSelection *editor_selection; - ProjectExport *project_export; - ProjectExportDialog *project_export_settings; +// ProjectExport *project_export; +// ProjectExportDialog *project_export_settings; EditorResourcePreview *resource_preview; EditorFileServer *file_server; @@ -647,9 +647,6 @@ public: void add_control_to_dock(DockSlot p_slot,Control* p_control); void remove_control_from_dock(Control* p_control); - void add_editor_import_plugin(const Ref& p_editor_import); - void remove_editor_import_plugin(const Ref& p_editor_import); - void set_addon_plugin_enabled(const String& p_addon,bool p_enabled); bool is_addon_plugin_enabled(const String &p_addon) const; diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp index 2f59b0bd072..2f44b5558c7 100644 --- a/tools/editor/editor_plugin.cpp +++ b/tools/editor/editor_plugin.cpp @@ -319,27 +319,6 @@ EditorResourcePreview *EditorPlugin::get_resource_previewer() { return EditorResourcePreview::get_singleton(); } -void EditorPlugin::add_import_plugin(const Ref& p_editor_import) { - - EditorNode::get_singleton()->add_editor_import_plugin(p_editor_import); -} - -void EditorPlugin::remove_import_plugin(const Ref& p_editor_import){ - - EditorNode::get_singleton()->remove_editor_import_plugin(p_editor_import); - -} - -void EditorPlugin::add_export_plugin(const Ref& p_editor_export){ - - EditorImportExport::get_singleton()->add_export_plugin(p_editor_export); -} -void EditorPlugin::remove_export_plugin(const Ref& p_editor_export){ - - EditorImportExport::get_singleton()->remove_export_plugin(p_editor_export); - -} - Control *EditorPlugin::get_base_control() { return EditorNode::get_singleton()->get_gui_base(); @@ -378,12 +357,6 @@ void EditorPlugin::_bind_methods() { ClassDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type); ClassDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport); - ClassDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::add_import_plugin); - ClassDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::remove_import_plugin); - - ClassDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::add_export_plugin); - ClassDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::remove_export_plugin); - ClassDB::bind_method(_MD("get_resource_previewer:EditorResourcePreview"),&EditorPlugin::get_resource_previewer); ClassDB::bind_method(_MD("get_resource_filesystem:EditorFileSystem"),&EditorPlugin::get_resource_file_system); diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h index 928b0968591..cf998dd55b0 100644 --- a/tools/editor/editor_plugin.h +++ b/tools/editor/editor_plugin.h @@ -139,12 +139,6 @@ public: void make_bottom_panel_item_visible(Control *p_item); void hide_bottom_panel(); - void add_import_plugin(const Ref& p_editor_import); - void remove_import_plugin(const Ref& p_editor_import); - - void add_export_plugin(const Ref& p_editor_export); - void remove_export_plugin(const Ref& p_editor_export); - EditorSelection* get_selection(); //EditorImportExport *get_import_export(); EditorSettings *get_editor_settings(); diff --git a/tools/editor/editor_reimport_dialog.cpp b/tools/editor/editor_reimport_dialog.cpp index e5ae33e9195..5904070230a 100644 --- a/tools/editor/editor_reimport_dialog.cpp +++ b/tools/editor/editor_reimport_dialog.cpp @@ -31,6 +31,7 @@ #include "editor_file_system.h" #include "editor_node.h" +#if 0 void EditorReImportDialog::popup_reimport() { if (EditorFileSystem::get_singleton()->is_scanning()) { @@ -144,3 +145,4 @@ EditorReImportDialog::EditorReImportDialog() { scene_must_save=false; } +#endif diff --git a/tools/editor/editor_reimport_dialog.h b/tools/editor/editor_reimport_dialog.h index 68e1ca05973..7379c70c5ea 100644 --- a/tools/editor/editor_reimport_dialog.h +++ b/tools/editor/editor_reimport_dialog.h @@ -29,6 +29,7 @@ #ifndef EDITOR_REIMPORT_DIALOG_H #define EDITOR_REIMPORT_DIALOG_H +#if 0 #include "scene/gui/dialogs.h" #include "scene/gui/tree.h" @@ -49,3 +50,4 @@ public: }; #endif // EDITOR_REIMPORT_DIALOG_H +#endif diff --git a/tools/editor/editor_run_native.cpp b/tools/editor/editor_run_native.cpp index 12b7b761ed4..25cb41befc7 100644 --- a/tools/editor/editor_run_native.cpp +++ b/tools/editor/editor_run_native.cpp @@ -32,7 +32,7 @@ void EditorRunNative::_notification(int p_what) { - +#if 0 if (p_what==NOTIFICATION_ENTER_TREE) { List ep; @@ -97,11 +97,12 @@ void EditorRunNative::_notification(int p_what) { first=false; } } - +#endif } void EditorRunNative::_run_native(int p_idx,const String& p_platform) { +#if 0 Ref eep = EditorImportExport::get_singleton()->get_export_platform(p_platform); ERR_FAIL_COND(eep.is_null()); if (p_idx == -1) { @@ -125,6 +126,8 @@ void EditorRunNative::_run_native(int p_idx,const String& p_platform) { flags|=EditorExportPlatform::EXPORT_VIEW_NAVIGATION; eep->run(p_idx,flags); + +#endif } void EditorRunNative::_bind_methods() { diff --git a/tools/editor/filesystem_dock.cpp b/tools/editor/filesystem_dock.cpp index 021d5c4eb95..2af56506051 100644 --- a/tools/editor/filesystem_dock.cpp +++ b/tools/editor/filesystem_dock.cpp @@ -363,11 +363,11 @@ void FileSystemDock::_search(EditorFileSystemDirectory *p_path,List* m fi.import_status=0; } for(int j=0;jget_source_count(i);j++) { - String s = EditorImportPlugin::expand_source_path(p_path->get_source_file(i,j)); + /*String s = EditorImportPlugin::expand_source_path(p_path->get_source_file(i,j)); if (p_path->is_source_file_missing(i,j)) { s+=" (Missing)"; } - fi.sources.push_back(s); + fi.sources.push_back(s);*/ } matches->push_back(fi); @@ -510,11 +510,11 @@ void FileSystemDock::_update_files(bool p_keep_selection) { } for(int j=0;jget_source_count(i);j++) { - String s = EditorImportPlugin::expand_source_path(efd->get_source_file(i,j)); + /*String s = EditorImportPlugin::expand_source_path(efd->get_source_file(i,j)); if (efd->is_source_file_missing(i,j)) { s+=" (Missing)"; } - fi.sources.push_back(s); + fi.sources.push_back(s);*/ } } else { fi.import_status=0; @@ -1068,7 +1068,7 @@ void FileSystemDock::_file_option(int p_option) { } ERR_FAIL_COND(reimport.size()==0); - +/* Ref rimd = ResourceLoader::load_import_metadata(reimport[0]); ERR_FAIL_COND(!rimd.is_valid()); String editor=rimd->get_editor(); @@ -1086,6 +1086,7 @@ void FileSystemDock::_file_option(int p_option) { rimp->reimport_multiple_files(reimport); } + */ } break; case FILE_COPY_PATH: @@ -1542,6 +1543,7 @@ void FileSystemDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) { } else { + /* Ref rimd = ResourceLoader::load_import_metadata(path); if (rimd.is_valid()) { @@ -1554,7 +1556,7 @@ void FileSystemDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) { } else { all_can_reimport=false; - } + }*/ } } else { all_can_reimport=false; @@ -1603,7 +1605,7 @@ void FileSystemDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) { if (all_can_reimport && types.size()==1) { //all can reimport and are of the same type - +/* bool valid=true; Ref rimp = EditorImportExport::get_singleton()->get_import_plugin_by_name(types.front()->get()); if (rimp.is_valid()) { @@ -1619,6 +1621,7 @@ void FileSystemDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) { file_options->add_separator(); file_options->add_item(TTR("Re-Import.."),FILE_REIMPORT); } + */ } file_options->set_pos(files->get_global_pos() + p_pos); diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp index 222a9d95176..587353fef8f 100644 --- a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "editor_bitmask_import_plugin.h" - +#if 0 #include "io/image_loader.h" #include "tools/editor/editor_file_dialog.h" #include "tools/editor/editor_dir_dialog.h" @@ -384,3 +384,4 @@ EditorBitMaskImportPlugin::EditorBitMaskImportPlugin(EditorNode* p_editor) { EditorBitMaskExportPlugin::EditorBitMaskExportPlugin() { } +#endif diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.h b/tools/editor/io_plugins/editor_bitmask_import_plugin.h index 3a6aababe29..89ff58ec937 100644 --- a/tools/editor/io_plugins/editor_bitmask_import_plugin.h +++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.h @@ -28,7 +28,7 @@ /*************************************************************************/ #ifndef EDITOR_BITMASK_IMPORT_PLUGIN_H #define EDITOR_BITMASK_IMPORT_PLUGIN_H - +#if 0 #include "tools/editor/editor_import_export.h" #include "scene/resources/font.h" @@ -66,4 +66,5 @@ public: EditorBitMaskExportPlugin(); }; +#endif #endif // EDITOR_SAMPLE_IMPORT_PLUGIN_H diff --git a/tools/editor/io_plugins/editor_export_scene.cpp b/tools/editor/io_plugins/editor_export_scene.cpp index 7d19258411d..f4ab9880ffe 100644 --- a/tools/editor/io_plugins/editor_export_scene.cpp +++ b/tools/editor/io_plugins/editor_export_scene.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "editor_export_scene.h" - +#if 0 #include "io/resource_loader.h" #include "io/resource_saver.h" #include "os/dir_access.h" @@ -139,3 +139,4 @@ Vector EditorSceneExportPlugin::custom_export(String& p_path,const Ref< EditorSceneExportPlugin::EditorSceneExportPlugin() { } +#endif diff --git a/tools/editor/io_plugins/editor_export_scene.h b/tools/editor/io_plugins/editor_export_scene.h index 13493220cbd..191029bd84b 100644 --- a/tools/editor/io_plugins/editor_export_scene.h +++ b/tools/editor/io_plugins/editor_export_scene.h @@ -31,7 +31,7 @@ #include "tools/editor/editor_import_export.h" - +#if 0 class EditorSceneExportPlugin : public EditorExportPlugin { GDCLASS( EditorSceneExportPlugin, EditorExportPlugin ); public: @@ -40,5 +40,5 @@ public: EditorSceneExportPlugin(); }; - +#endif #endif // EDITOR_EXPORT_SCENE_H diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index 0deb5cbbfa6..417aad0db81 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "editor_font_import_plugin.h" - +#if 0 #include "scene/gui/dialogs.h" #include "tools/editor/editor_file_dialog.h" #include "tools/editor/editor_node.h" @@ -1701,3 +1701,4 @@ EditorFontImportPlugin::EditorFontImportPlugin(EditorNode* p_editor) { dialog = memnew( EditorFontImportDialog(this) ); p_editor->get_gui_base()->add_child(dialog); } +#endif diff --git a/tools/editor/io_plugins/editor_font_import_plugin.h b/tools/editor/io_plugins/editor_font_import_plugin.h index 73c699c0904..a5b265736fc 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.h +++ b/tools/editor/io_plugins/editor_font_import_plugin.h @@ -31,7 +31,7 @@ #include "tools/editor/editor_import_export.h" #include "scene/resources/font.h" - +#if 0 class EditorNode; class EditorFontImportDialog; @@ -55,3 +55,4 @@ public: }; #endif // EDITOR_FONT_IMPORT_PLUGIN_H +#endif diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp index a910b9c3abc..963347f18b7 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/io_plugins/editor_import_collada.cpp @@ -28,6 +28,7 @@ /*************************************************************************/ #include "editor_import_collada.h" +#if 0 #include "collada/collada.h" #include "scene/3d/spatial.h" #include "scene/3d/skeleton.h" @@ -2464,3 +2465,4 @@ EditorSceneImporterCollada::EditorSceneImporterCollada() { } +#endif diff --git a/tools/editor/io_plugins/editor_import_collada.h b/tools/editor/io_plugins/editor_import_collada.h index f6642778ed7..c325b58e322 100644 --- a/tools/editor/io_plugins/editor_import_collada.h +++ b/tools/editor/io_plugins/editor_import_collada.h @@ -31,7 +31,7 @@ #include "tools/editor/io_plugins/editor_scene_import_plugin.h" - +#if 0 class EditorSceneImporterCollada : public EditorSceneImporter { @@ -46,6 +46,6 @@ public: EditorSceneImporterCollada(); }; - +#endif #endif diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp index d07a21fc7de..fc3f8fd8c97 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -28,6 +28,8 @@ /*************************************************************************/ #include "editor_mesh_import_plugin.h" +#if 0 + #include "tools/editor/editor_file_dialog.h" #include "tools/editor/editor_dir_dialog.h" #include "tools/editor/editor_node.h" @@ -588,3 +590,4 @@ EditorMeshImportPlugin::EditorMeshImportPlugin(EditorNode* p_editor) { dialog = memnew( EditorMeshImportDialog(this)); p_editor->get_gui_base()->add_child(dialog); } +#endif diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.h b/tools/editor/io_plugins/editor_mesh_import_plugin.h index 1f15fee3a7f..ba8ec581911 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.h +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.h @@ -29,7 +29,7 @@ #ifndef EDITOR_MESH_IMPORT_PLUGIN_H #define EDITOR_MESH_IMPORT_PLUGIN_H - +#if 0 #include "tools/editor/editor_import_export.h" #include "scene/resources/font.h" @@ -55,4 +55,5 @@ public: EditorMeshImportPlugin(EditorNode* p_editor); }; +#endif #endif // EDITOR_MESH_IMPORT_PLUGIN_H diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index ce6c49fcba5..bffccb90724 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "editor_scene_import_plugin.h" - +#if 0 #include "globals.h" #include "tools/editor/editor_node.h" #include "scene/resources/packed_scene.h" @@ -2989,3 +2989,4 @@ EditorSceneAnimationImportPlugin::EditorSceneAnimationImportPlugin(EditorNode* p } +#endif diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.h b/tools/editor/io_plugins/editor_scene_import_plugin.h index 61153e36546..bbafc126bb6 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.h +++ b/tools/editor/io_plugins/editor_scene_import_plugin.h @@ -28,7 +28,7 @@ /*************************************************************************/ #ifndef EDITOR_SCENE_IMPORT_PLUGIN_H #define EDITOR_SCENE_IMPORT_PLUGIN_H - +#if 0 #include "scene/gui/dialogs.h" #include "scene/gui/tree.h" #include "scene/gui/label.h" @@ -196,5 +196,5 @@ public: }; - +#endif #endif // EDITOR_SCENE_IMPORT_PLUGIN_H diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 8e1bcb8e4bf..c41199f2913 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "editor_texture_import_plugin.h" - +#if 0 #include "io/image_loader.h" #include "tools/editor/editor_node.h" #include "io/resource_saver.h" @@ -1890,3 +1890,4 @@ EditorTextureExportPlugin::EditorTextureExportPlugin() { } +#endif diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.h b/tools/editor/io_plugins/editor_texture_import_plugin.h index b2117f1475a..08e0db5d6ee 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.h +++ b/tools/editor/io_plugins/editor_texture_import_plugin.h @@ -29,6 +29,7 @@ #ifndef EDITOR_TEXTURE_IMPORT_PLUGIN_H #define EDITOR_TEXTURE_IMPORT_PLUGIN_H +#if 0 #include "tools/editor/editor_import_export.h" #include "scene/gui/dialogs.h" #include "scene/gui/tree.h" @@ -170,3 +171,4 @@ public: }; #endif // EDITOR_TEXTURE_IMPORT_PLUGIN_H +#endif diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp index 7079120feba..9438af90724 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -28,6 +28,7 @@ /*************************************************************************/ #include "editor_translation_import_plugin.h" +#if 0 #include "scene/gui/file_dialog.h" #include "tools/editor/editor_dir_dialog.h" #include "tools/editor/editor_node.h" @@ -474,3 +475,5 @@ EditorTranslationImportPlugin::EditorTranslationImportPlugin(EditorNode* p_edito dialog = memnew(EditorTranslationImportDialog(this)); p_editor->get_gui_base()->add_child(dialog); } + +#endif diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.h b/tools/editor/io_plugins/editor_translation_import_plugin.h index 38727bd778f..4884ea71c52 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.h +++ b/tools/editor/io_plugins/editor_translation_import_plugin.h @@ -31,7 +31,7 @@ #include "tools/editor/editor_import_export.h" #include "scene/resources/font.h" - +#if 0 class EditorNode; class EditorTranslationImportDialog; @@ -52,4 +52,5 @@ public: EditorTranslationImportPlugin(EditorNode* p_editor); }; +#endif #endif // EDITOR_TRANSLATION_IMPORT_PLUGIN_H diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index cacefaa1a29..4472cff9ccd 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "project_export.h" - +#if 0 #include "os/dir_access.h" #include "os/file_access.h" #include "globals.h" @@ -2127,3 +2127,4 @@ ProjectExport::ProjectExport(EditorData* p_data) { } +#endif diff --git a/tools/editor/project_export.h b/tools/editor/project_export.h index 06992a7e347..c528a231219 100644 --- a/tools/editor/project_export.h +++ b/tools/editor/project_export.h @@ -46,6 +46,7 @@ #include "property_editor.h" #include "editor_import_export.h" +#if 0 class EditorNode; class ProjectExportDialog : public ConfirmationDialog { @@ -242,3 +243,4 @@ public: #endif // PROJECT_EXPORT_SETTINGS_H +#endif diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 15d03b8a2bc..764d1e45469 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -1342,7 +1342,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { hbc->add_spacer(); - List ep; + /*List ep; EditorImportExport::get_singleton()->get_export_platforms(&ep); ep.sort_custom(); @@ -1350,7 +1350,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { popup_platform->get_popup()->add_item( E->get() ); - } + }*/ popup_platform->get_popup()->connect("id_pressed",this,"_copy_to_platform"); get_ok()->set_text(TTR("Close")); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index e5dce0524fc..19720dfd654 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -208,13 +208,13 @@ void CustomPropertyEditor::_menu_option(int p_which) { case OBJ_MENU_REIMPORT: { RES r=v; - if (r.is_valid() && r->get_import_metadata().is_valid()) { +/* if (r.is_valid() && r->get_import_metadata().is_valid()) { Ref rimd = r->get_import_metadata(); Ref eip = EditorImportExport::get_singleton()->get_import_plugin_by_name(rimd->get_editor()); if (eip.is_valid()) { eip->import_dialog(r->get_path()); } - } + }*/ } break; case OBJ_MENU_NEW_SCRIPT: { @@ -945,11 +945,11 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty menu->add_icon_item(get_icon("EditResource","EditorIcons"),"Edit",OBJ_MENU_EDIT); menu->add_icon_item(get_icon("Del","EditorIcons"),"Clear",OBJ_MENU_CLEAR); menu->add_icon_item(get_icon("Duplicate","EditorIcons"),"Make Unique",OBJ_MENU_MAKE_UNIQUE); - RES r = v; + /*RES r = v; if (r.is_valid() && r->get_path().is_resource_file() && r->get_import_metadata().is_valid()) { menu->add_separator(); menu->add_icon_item(get_icon("ReloadSmall","EditorIcons"),"Re-Import",OBJ_MENU_REIMPORT); - } + }*/ /*if (r.is_valid() && r->get_path().is_resource_file()) { menu->set_item_tooltip(1,r->get_path()); } else if (r.is_valid()) {