diff options
80 files changed, 2484 insertions, 465 deletions
diff --git a/core/globals.cpp b/core/globals.cpp index af3ec403d5..ed0b6f6d8b 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -38,6 +38,8 @@ #include "io/file_access_network.h" #include "variant_parser.h" +#define FORMAT_VERSION 3 + GlobalConfig *GlobalConfig::singleton=NULL; GlobalConfig *GlobalConfig::get_singleton() { @@ -123,6 +125,7 @@ bool GlobalConfig::_set(const StringName& p_name, const Variant& p_value) { _THREAD_SAFE_METHOD_ + if (p_value.get_type()==Variant::NIL) props.erase(p_name); else { @@ -253,7 +256,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { bool ok = _load_resource_pack(p_main_pack); ERR_FAIL_COND_V(!ok,ERR_CANT_OPEN); - if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { + if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { _load_settings("res://override.cfg"); @@ -275,7 +278,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { memdelete(d); } - if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { + if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { _load_settings("res://override.cfg"); @@ -291,7 +294,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { if (FileAccessNetworkClient::get_singleton()) { - if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { + if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { _load_settings("res://override.cfg"); @@ -311,9 +314,9 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { if (!_load_resource_pack("res://data.pck")) _load_resource_pack("res://data.zip"); // make sure this is load from the resource path - print_line("exists engine cfg? "+itos(FileAccess::exists("/engine.cfg"))); - if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { - print_line("loaded engine.cfg"); + print_line("exists engine cfg? "+itos(FileAccess::exists("/godot.cfg"))); + if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { + print_line("loaded godot.cfg"); _load_settings("res://override.cfg"); } @@ -341,7 +344,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { //tries to open pack, but only first time if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".zip") )) { - if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { + if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { _load_settings("res://override.cfg"); found=true; @@ -350,7 +353,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { } break; } else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.zip") )) { - if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { + if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { _load_settings("res://override.cfg"); found=true; @@ -358,7 +361,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { } break; - } else if (_load_settings(current_dir+"/engine.cfg")==OK || _load_settings_binary(current_dir+"/engine.cfb")==OK) { + } else if (_load_settings(current_dir+"/godot.cfg")==OK || _load_settings_binary(current_dir+"/godot.cfb")==OK) { _load_settings(current_dir+"/override.cfg"); candidate=current_dir; @@ -416,7 +419,7 @@ Error GlobalConfig::_load_settings_binary(const String p_path) { if (hdr[0]!='E'|| hdr[1]!='C' || hdr[2]!='F' || hdr[3]!='G') { memdelete(f); - ERR_EXPLAIN("Corrupted header in binary engine.cfb (not ECFG)"); + ERR_EXPLAIN("Corrupted header in binary godot.cfb (not ECFG)"); ERR_FAIL_V(ERR_FILE_CORRUPT;) } @@ -491,6 +494,14 @@ Error GlobalConfig::_load_settings(const String p_path) { } if (assign!=String()) { + if (section==String() && assign=="config_version") { + int config_version = value; + if (config_version > FORMAT_VERSION) { + memdelete(f); + ERR_FAIL_COND_V(config_version > FORMAT_VERSION,ERR_FILE_CANT_OPEN); + } + + } set(section+"/"+assign,value); } else if (next_tag.name!=String()) { section=next_tag.name; @@ -526,7 +537,7 @@ void GlobalConfig::clear(const String& p_name) { Error GlobalConfig::save() { - return save_custom(get_resource_path()+"/engine.cfg"); + return save_custom(get_resource_path()+"/godot.cfg"); } Error GlobalConfig::_save_settings_binary(const String& p_file,const Map<String,List<String> > &props,const CustomMap& p_custom) { @@ -536,7 +547,7 @@ Error GlobalConfig::_save_settings_binary(const String& p_file,const Map<String, FileAccess *file = FileAccess::open(p_file,FileAccess::WRITE,&err); if (err!=OK) { - ERR_EXPLAIN("Coudln't save engine.cfb at "+p_file); + ERR_EXPLAIN("Coudln't save godot.cfb at "+p_file); ERR_FAIL_COND_V(err,err) } @@ -604,10 +615,13 @@ Error GlobalConfig::_save_settings_text(const String& p_file,const Map<String,Li FileAccess *file = FileAccess::open(p_file,FileAccess::WRITE,&err); if (err) { - ERR_EXPLAIN("Coudln't save engine.cfg - "+p_file); + ERR_EXPLAIN("Coudln't save godot.cfg - "+p_file); ERR_FAIL_COND_V(err,err) } + file->store_string("config_version="+itos(FORMAT_VERSION)+"\n"); + + for(Map<String,List<String> >::Element *E=props.front();E;E=E->next()) { if (E!=props.front()) @@ -734,7 +748,7 @@ Error GlobalConfig::save_custom(const String& p_path,const CustomMap& p_custom,c Error err = file->open(dst_file,FileAccess::WRITE); if (err) { memdelete(file); - ERR_EXPLAIN("Coudln't save engine.cfg"); + ERR_EXPLAIN("Coudln't save godot.cfg"); ERR_FAIL_COND_V(err,err) } diff --git a/core/image.cpp b/core/image.cpp index 2d038691f2..037ff82452 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -245,7 +245,7 @@ void Image::_get_mipmap_offset_and_size(int p_mipmap,int &r_offset, int &r_width } int Image::get_mipmap_offset(int p_mipmap) const { - ERR_FAIL_INDEX_V(p_mipmap,(mipmaps+1),-1); + ERR_FAIL_INDEX_V(p_mipmap,get_mipmap_count()+1,-1); int ofs,w,h; _get_mipmap_offset_and_size(p_mipmap,ofs,w,h); @@ -1011,7 +1011,7 @@ void Image::shrink_x2() { } } -Error Image::generate_mipmaps(bool p_keep_existing) { +Error Image::generate_mipmaps() { if (!_can_modify(format)) { ERR_EXPLAIN("Cannot generate mipmaps in indexed, compressed or custom image formats."); @@ -1019,15 +1019,14 @@ Error Image::generate_mipmaps(bool p_keep_existing) { } - int mmcount = get_mipmap_count(); + ERR_FAIL_COND_V(width==0 || height==0,ERR_UNCONFIGURED); + + int mmcount; - int from_mm=1; - if (p_keep_existing) { - from_mm=mmcount+1; - } int size = _get_dst_image_size(width,height,format,mmcount); data.resize(size); + print_line("to gen mipmaps w "+itos(width)+" h "+itos(height) +" format "+get_format_name(format)+" mipmaps " +itos(mmcount)+" new size is: "+itos(size)); PoolVector<uint8_t>::Write wp=data.write(); @@ -1043,18 +1042,16 @@ Error Image::generate_mipmaps(bool p_keep_existing) { int ofs,w,h; _get_mipmap_offset_and_size(i,ofs, w,h); - if (i>=from_mm) { - switch(format) { + switch(format) { - case FORMAT_L8: - case FORMAT_R8: _generate_po2_mipmap<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_LA8: - case FORMAT_RG8: _generate_po2_mipmap<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_RGB8: _generate_po2_mipmap<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_RGBA8: _generate_po2_mipmap<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - default: {} - } + case FORMAT_L8: + case FORMAT_R8: _generate_po2_mipmap<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_LA8: + case FORMAT_RG8: _generate_po2_mipmap<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_RGB8: _generate_po2_mipmap<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_RGBA8: _generate_po2_mipmap<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + default: {} } prev_ofs=ofs; @@ -1077,18 +1074,15 @@ Error Image::generate_mipmaps(bool p_keep_existing) { int ofs,w,h; _get_mipmap_offset_and_size(i,ofs, w,h); - if (i>=from_mm) { - - switch(format) { + switch(format) { - case FORMAT_L8: - case FORMAT_R8: _scale_bilinear<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_LA8: - case FORMAT_RG8: _scale_bilinear<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_RGB8:_scale_bilinear<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_RGBA8: _scale_bilinear<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - default: {} - } + case FORMAT_L8: + case FORMAT_R8: _scale_bilinear<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_LA8: + case FORMAT_RG8: _scale_bilinear<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_RGB8:_scale_bilinear<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_RGBA8: _scale_bilinear<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + default: {} } prev_ofs=ofs; @@ -1096,8 +1090,11 @@ Error Image::generate_mipmaps(bool p_keep_existing) { prev_h=h; } + + } + mipmaps=true; return OK; } @@ -1154,7 +1151,7 @@ void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_forma ERR_FAIL_INDEX(p_height-1,MAX_HEIGHT); int mm; - int size = _get_dst_image_size(p_width,p_height,p_format,mm,p_use_mipmaps); + int size = _get_dst_image_size(p_width,p_height,p_format,mm,p_use_mipmaps?-1:0); if (size!=p_data.size()) { ERR_EXPLAIN("Expected data size of "+itos(size)+" in Image::create()"); diff --git a/core/image.h b/core/image.h index 620160147b..1a257f28a0 100644 --- a/core/image.h +++ b/core/image.h @@ -196,7 +196,7 @@ public: /** * Generate a mipmap to an image (creates an image 1/4 the size, with averaging of 4->1) */ - Error generate_mipmaps(bool p_keep_existing=false); + Error generate_mipmaps(); void clear_mipmaps(); diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp index d0799cdbe6..556dff3125 100644 --- a/core/io/resource_import.cpp +++ b/core/io/resource_import.cpp @@ -1,5 +1,6 @@ #include "resource_import.h" #include "variant_parser.h" +#include "os/os.h" Error ResourceFormatImporter::_get_path_and_type(const String& p_path, PathAndType &r_path_and_type) const { @@ -36,7 +37,13 @@ Error ResourceFormatImporter::_get_path_and_type(const String& p_path, PathAndTy } if (assign!=String()) { - if (assign=="path") { + if (assign.begins_with("path.") && r_path_and_type.path==String()) { + String feature = assign.get_slicec('.',1); + if (OS::get_singleton()->check_feature_support(feature)) { + r_path_and_type.path=value; + } + + } else if (assign=="path") { r_path_and_type.path=value; } else if (assign=="type") { r_path_and_type.type=value; @@ -84,7 +91,6 @@ RES ResourceFormatImporter::load(const String &p_path,const String& p_original_p void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extensions) const{ - print_line("getting exts from: "+itos(importers.size())); Set<String> found; for (Set< Ref<ResourceImporter> >::Element *E=importers.front();E;E=E->next()) { @@ -92,7 +98,6 @@ void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extension E->get()->get_recognized_extensions(&local_exts); for (List<String>::Element *F=local_exts.front();F;F=F->next()) { if (!found.has(F->get())) { - print_line("adding ext "+String(F->get())); p_extensions->push_back(F->get()); found.insert(F->get()); } @@ -154,6 +159,20 @@ bool ResourceFormatImporter::handles_type(const String& p_type) const { return true; } + +String ResourceFormatImporter::get_internal_resource_path(const String& p_path) const { + + PathAndType pat; + Error err = _get_path_and_type(p_path,pat); + + if (err!=OK) { + + return String(); + } + + return pat.path; +} + String ResourceFormatImporter::get_resource_type(const String &p_path) const { PathAndType pat; diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 939cecfbd9..387b3902fe 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -31,6 +31,7 @@ public: virtual bool can_be_imported(const String& p_path) const; + String get_internal_resource_path(const String& p_path) const; void add_importer(const Ref<ResourceImporter>& p_importer) { importers.insert(p_importer); } Ref<ResourceImporter> get_importer_by_name(const String& p_name); diff --git a/core/os/os.h b/core/os/os.h index 42c7c18b0c..e179b82dae 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -403,6 +403,8 @@ public: virtual void set_use_vsync(bool p_enable); virtual bool is_vsync_enabled() const; + virtual bool check_feature_support(const String& p_feature)=0; + bool is_hidpi_allowed() const { return _allow_hidpi; } OS(); virtual ~OS(); diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 1e938b4899..3507501f27 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -430,7 +430,7 @@ Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector<String>& strings, Token token; get_token(p_stream,token,line,r_err_str); if (token.type!=TK_PARENTHESIS_OPEN) { - r_err_str="Expected '(' in old-style engine.cfg construct"; + r_err_str="Expected '(' in old-style godot.cfg construct"; return ERR_PARSE_ERROR; } @@ -442,7 +442,7 @@ Error VariantParser::_parse_enginecfg(Stream *p_stream, Vector<String>& strings, CharType c=p_stream->get_char(); if (p_stream->is_eof()) { - r_err_str="Unexpected EOF while parsing old-style engine.cfg construct"; + r_err_str="Unexpected EOF while parsing old-style godot.cfg construct"; return ERR_PARSE_ERROR; } @@ -1328,7 +1328,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=arr; return OK; - } else if (id=="key") { // compatibility with engine.cfg + } else if (id=="key") { // compatibility with godot.cfg Vector<String> params; Error err = _parse_enginecfg(p_stream,params,line,r_err_str); @@ -1364,7 +1364,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=ie; return OK; - } else if (id=="mbutton") { // compatibility with engine.cfg + } else if (id=="mbutton") { // compatibility with godot.cfg Vector<String> params; Error err = _parse_enginecfg(p_stream,params,line,r_err_str); @@ -1379,7 +1379,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=ie; return OK; - } else if (id=="jbutton") { // compatibility with engine.cfg + } else if (id=="jbutton") { // compatibility with godot.cfg Vector<String> params; Error err = _parse_enginecfg(p_stream,params,line,r_err_str); @@ -1394,7 +1394,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=ie; return OK; - } else if (id=="jaxis") { // compatibility with engine.cfg + } else if (id=="jaxis") { // compatibility with godot.cfg Vector<String> params; Error err = _parse_enginecfg(p_stream,params,line,r_err_str); @@ -1412,19 +1412,19 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value= ie; return OK; - } else if (id=="img") { // compatibility with engine.cfg + } else if (id=="img") { // compatibility with godot.cfg Token token; get_token(p_stream,token,line,r_err_str); if (token.type!=TK_PARENTHESIS_OPEN) { - r_err_str="Expected '(' in old-style engine.cfg construct"; + r_err_str="Expected '(' in old-style godot.cfg construct"; return ERR_PARSE_ERROR; } while(true) { CharType c = p_stream->get_char(); if (p_stream->is_eof()) { - r_err_str="Unexpected EOF in old style engine.cfg img()"; + r_err_str="Unexpected EOF in old style godot.cfg img()"; return ERR_PARSE_ERROR; } if (c==')') diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 9223b887a3..8204af9fd4 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -14300,7 +14300,7 @@ Contains global variables accessible from everywhere. </brief_description> <description> - Contains global variables accessible from everywhere. Use the normal [Object] API, such as "Globals.get(variable)", "Globals.set(variable,value)" or "Globals.has(variable)" to access them. Variables stored in engine.cfg are also loaded into globals, making this object very useful for reading custom game configuration options. + Contains global variables accessible from everywhere. Use the normal [Object] API, such as "Globals.get(variable)", "Globals.set(variable,value)" or "Globals.has(variable)" to access them. Variables stored in godot.cfg are also loaded into globals, making this object very useful for reading custom game configuration options. </description> <methods> <method name="add_property_info"> diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index 5c6b9c5410..e1ddad0dc9 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -167,6 +167,7 @@ void RasterizerGLES3::initialize() { void RasterizerGLES3::begin_frame(){ + uint64_t tick = OS::get_singleton()->get_ticks_usec(); double time_total = double(tick)/1000000.0; diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index c0af9b3bcf..88a73d31cb 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -148,6 +148,9 @@ void RasterizerSceneGLES3::shadow_atlas_set_size(RID p_atlas,int p_size){ glClearDepth(0.0f); glClear(GL_DEPTH_BUFFER_BIT); + glBindFramebuffer(GL_FRAMEBUFFER,0); + + } } @@ -557,6 +560,8 @@ void RasterizerSceneGLES3::reflection_atlas_set_size(RID p_ref_atlas,int p_size) } + + void RasterizerSceneGLES3::reflection_atlas_set_subdivision(RID p_ref_atlas,int p_subdiv) { ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_ref_atlas); @@ -1081,6 +1086,18 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material* p_m state.current_line_width=p_material->line_width; } + if (state.current_depth_test!=(!p_material->shader->spatial.ontop)) { + if (p_material->shader->spatial.ontop) { + glDisable(GL_DEPTH_TEST); + + } else { + glEnable(GL_DEPTH_TEST); + + } + + state.current_depth_test=!p_material->shader->spatial.ontop; + } + if (state.current_depth_draw!=p_material->shader->spatial.depth_draw_mode) { switch(p_material->shader->spatial.depth_draw_mode) { case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS: @@ -1204,6 +1221,11 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material* p_m } else { +#ifdef TOOLS_ENABLED + if (t->detect_3d) { + t->detect_3d(t->detect_3d_ud); + } +#endif if (storage->config.srgb_decode_supported) { //if SRGB decode extension is present, simply switch the texture to whathever is needed bool must_srgb=false; @@ -1216,9 +1238,8 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material* p_m if (must_srgb) { glTexParameteri(t->target,_TEXTURE_SRGB_DECODE_EXT,_DECODE_EXT); #ifdef TOOLS_ENABLED - if (!(t->flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { - t->flags|=VS::TEXTURE_FLAG_CONVERT_TO_LINEAR; - //notify that texture must be set to linear beforehand, so it works in other platforms when exported + if (t->detect_srgb) { + t->detect_srgb(t->detect_srgb_ud); } #endif @@ -1714,6 +1735,9 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements,int p_e state.cull_front=false; glCullFace(GL_BACK); + state.current_depth_test=true; + glEnable(GL_DEPTH_TEST); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON,false); state.current_blend_mode=-1; @@ -4403,18 +4427,18 @@ void RasterizerSceneGLES3::render_shadow(RID p_light,RID p_shadow_atlas,int p_pa render_list.sort_by_depth(false); //shadow is front to back for performance - glDepthMask(true); - glColorMask(1,1,1,1); glDisable(GL_BLEND); glDisable(GL_DITHER); glEnable(GL_DEPTH_TEST); glBindFramebuffer(GL_FRAMEBUFFER,fbo); + glDepthMask(true); + glColorMask(0,0,0,0); + if (custom_vp_size) { glViewport(0,0,custom_vp_size,custom_vp_size); glScissor(0,0,custom_vp_size,custom_vp_size); - } else { glViewport(x,y,width,height); glScissor(x,y,width,height); @@ -5009,5 +5033,4 @@ void RasterizerSceneGLES3::finalize(){ RasterizerSceneGLES3::RasterizerSceneGLES3() { - } diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 7838345e59..8304b3742f 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -61,6 +61,7 @@ public: int current_blend_mode; float current_line_width; int current_depth_draw; + bool current_depth_test; GLuint current_main_tex; SceneShaderGLES3 scene_shader; @@ -209,7 +210,6 @@ public: bool _shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas, int *p_in_quadrants, int p_quadrant_count, int p_current_subdiv, uint64_t p_tick, int &r_quadrant, int &r_shadow); bool shadow_atlas_update_light(RID p_atlas,RID p_light_intance,float p_coverage,uint64_t p_light_version); - struct DirectionalShadow { GLuint fbo; GLuint depth; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index a96fd8dd41..7b43d1a115 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -218,7 +218,7 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image& p_image, Ima if (config.s3tc_supported) { - r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV:_EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT; + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_S3TC_DXT1_NV:_EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT; r_gl_format=GL_RGBA; r_gl_type=GL_UNSIGNED_BYTE; r_compressed=true; @@ -785,7 +785,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture,const Image& p_image if (texture->compressed) { glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glCompressedTexImage2D( blit_target, i, format,w,h,0,size,&read[ofs] ); + glCompressedTexImage2D( blit_target, i, internal_format,w,h,0,size,&read[ofs] ); } else { glPixelStorei(GL_UNPACK_ALIGNMENT, 1); @@ -814,6 +814,10 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture,const Image& p_image if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && mipmaps==1 && !texture->ignore_mipmaps && (!(texture->flags&VS::TEXTURE_FLAG_CUBEMAP) || texture->stored_cube_sides==(1<<6)-1)) { //generate mipmaps if they were requested and the image does not contain them glGenerateMipmap(texture->target); + } else if (mipmaps>1) { + glTexParameteri(texture->target, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, mipmaps-1); + } texture->mipmaps=mipmaps; @@ -1066,6 +1070,26 @@ void RasterizerStorageGLES3::textures_keep_original(bool p_enable) { config.keep_original_textures=p_enable; } +void RasterizerStorageGLES3::texture_set_detect_3d_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata) { + + Texture * texture = texture_owner.get(p_texture); + ERR_FAIL_COND(!texture); + + texture->detect_3d=p_callback; + texture->detect_3d_ud=p_userdata; +} + +void RasterizerStorageGLES3::texture_set_detect_srgb_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata){ + Texture * texture = texture_owner.get(p_texture); + ERR_FAIL_COND(!texture); + + texture->detect_srgb=p_callback; + texture->detect_srgb_ud=p_userdata; + +} + + + RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source,int p_resolution) const { Texture * texture = texture_owner.get(p_source); @@ -1515,12 +1539,12 @@ void RasterizerStorageGLES3::_update_shader(Shader* p_shader) const { actions->uniforms=&p_shader->uniforms; - } + } break; case VS::SHADER_PARTICLES: { actions=&shaders.actions_particles; actions->uniforms=&p_shader->uniforms; - } + } break; } @@ -2471,6 +2495,7 @@ RID RasterizerStorageGLES3::mesh_create(){ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes,const Vector<Rect3>& p_bone_aabbs){ + PoolVector<uint8_t> array = p_array; Mesh *mesh = mesh_owner.getornull(p_mesh); @@ -2669,8 +2694,6 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::P int array_size = stride * p_vertex_count; int index_array_size=0; - - print_line("desired size: "+itos(array_size)+" vcount "+itos(p_vertex_count)+" should be: "+itos(array.size()+p_vertex_count*2)+" but is "+itos(array.size())); if (array.size()!=array_size && array.size()+p_vertex_count*2 == array_size) { //old format, convert array = PoolVector<uint8_t>(); @@ -4753,6 +4776,7 @@ RID RasterizerStorageGLES3::gi_probe_create() { gip->bounds=Rect3(Vector3(),Vector3(1,1,1)); gip->dynamic_range=1.0; gip->energy=1.0; + gip->propagation=1.0; gip->interior=false; gip->compress=false; gip->version=1; @@ -4858,6 +4882,15 @@ void RasterizerStorageGLES3::gi_probe_set_energy(RID p_probe,float p_range){ } +void RasterizerStorageGLES3::gi_probe_set_propagation(RID p_probe,float p_range){ + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->propagation=p_range; + +} + void RasterizerStorageGLES3::gi_probe_set_interior(RID p_probe,bool p_enable) { GIProbe *gip = gi_probe_owner.getornull(p_probe); @@ -4902,6 +4935,16 @@ float RasterizerStorageGLES3::gi_probe_get_energy(RID p_probe) const{ return gip->energy; } +float RasterizerStorageGLES3::gi_probe_get_propagation(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,0); + + return gip->propagation; +} + + + uint32_t RasterizerStorageGLES3::gi_probe_get_version(RID p_probe) { @@ -5403,12 +5446,14 @@ void RasterizerStorageGLES3::instance_remove_dependency(RID p_base,RasterizerSce void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { + if (rt->fbo) { glDeleteFramebuffers(1,&rt->fbo); glDeleteTextures(1,&rt->color); rt->fbo=0; } + if (rt->buffers.fbo) { glDeleteFramebuffers(1,&rt->buffers.fbo); glDeleteRenderbuffers(1,&rt->buffers.depth); @@ -5422,11 +5467,13 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { rt->buffers.fbo=0; } + if (rt->depth) { glDeleteTextures(1,&rt->depth); rt->depth=0; } + if (rt->effects.ssao.blur_fbo[0]) { glDeleteFramebuffers(1,&rt->effects.ssao.blur_fbo[0]); glDeleteTextures(1,&rt->effects.ssao.blur_red[0]); @@ -5439,11 +5486,16 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { rt->effects.ssao.depth_mipmap_fbos.clear(); glDeleteTextures(1,&rt->effects.ssao.linear_depth); + + rt->effects.ssao.blur_fbo[0]=0; + rt->effects.ssao.blur_fbo[1]=0; } + if (rt->exposure.fbo) { glDeleteFramebuffers(1,&rt->exposure.fbo); glDeleteTextures(1,&rt->exposure.color); + rt->exposure.fbo=0; } Texture *tex = texture_owner.get(rt->texture); tex->alloc_height=0; @@ -5451,6 +5503,7 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { tex->width=0; tex->height=0; + for(int i=0;i<2;i++) { for(int j=0;j<rt->effects.mip_maps[i].sizes.size();j++) { glDeleteFramebuffers(1,&rt->effects.mip_maps[i].sizes[j].fbo); @@ -5460,6 +5513,8 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { rt->effects.mip_maps[i].sizes.clear(); rt->effects.mip_maps[i].levels=0; } + + /* if (rt->effects.screen_space_depth) { glDeleteTextures(1,&rt->effects.screen_space_depth); @@ -5474,7 +5529,6 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){ if (rt->width<=0 || rt->height<=0) return; - GLuint color_internal_format; GLuint color_format; GLuint color_type; @@ -6294,6 +6348,25 @@ bool RasterizerStorageGLES3::free(RID p_rid){ return true; } + +bool RasterizerStorageGLES3::has_os_feature(const String& p_feature) const { + + if (p_feature=="s3tc") + return config.s3tc_supported; + + if (p_feature=="etc") + return config.etc_supported; + + if (p_feature=="etc2") + return config.etc2_supported; + + if (p_feature=="pvrtc") + return config.pvrtc_supported; + + return false; + +} + //////////////////////////////////////////// diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index c8f04f72c1..07998886a8 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -228,6 +228,12 @@ public: Image images[6]; + VisualServer::TextureDetectCallback detect_3d; + void *detect_3d_ud; + + VisualServer::TextureDetectCallback detect_srgb; + void *detect_srgb_ud; + Texture() { using_srgb=false; @@ -243,6 +249,10 @@ public: total_data_size=0; target=GL_TEXTURE_2D; mipmaps=0; + detect_3d=NULL; + detect_3d_ud=NULL; + detect_srgb=NULL; + detect_srgb_ud=NULL; } @@ -281,6 +291,10 @@ public: virtual void textures_keep_original(bool p_enable); + virtual void texture_set_detect_3d_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata); + virtual void texture_set_detect_srgb_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata); + + /* SKYBOX API */ struct SkyBox : public RID_Data { @@ -907,6 +921,7 @@ public: int dynamic_range; float energy; + float propagation; bool interior; bool compress; @@ -939,6 +954,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range); virtual float gi_probe_get_energy(RID p_probe) const; + virtual void gi_probe_set_propagation(RID p_probe,float p_range); + virtual float gi_probe_get_propagation(RID p_probe) const; + virtual void gi_probe_set_interior(RID p_probe,bool p_enable); virtual bool gi_probe_is_interior(RID p_probe) const; @@ -1160,9 +1178,11 @@ public: height=0; depth=0; fbo=0; + exposure.fbo=0; buffers.fbo=0; used_in_frame=false; + flags[RENDER_TARGET_VFLIP]=false; flags[RENDER_TARGET_TRANSPARENT]=false; flags[RENDER_TARGET_NO_3D]=false; @@ -1237,6 +1257,7 @@ public: void initialize(); void finalize(); + virtual bool has_os_feature(const String& p_feature) const; RasterizerStorageGLES3(); diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 97872226a4..12aac79912 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -582,6 +582,7 @@ Error ShaderCompilerGLES3::compile(VS::ShaderMode p_mode, const String& p_code, used_name_defines.clear(); used_rmode_defines.clear(); + used_flag_pointers.clear(); _dump_node_code(parser.get_shader(),1,r_gen_code,*p_actions,actions[p_mode]); diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 283cff0486..cc69283f97 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -30,6 +30,7 @@ #ifdef UNIX_ENABLED +#include "servers/visual_server.h" #include "thread_posix.h" #include "semaphore_posix.h" @@ -478,6 +479,13 @@ String OS_Unix::get_data_dir() const { } +bool OS_Unix::check_feature_support(const String& p_feature) { + + return VisualServer::get_singleton()->has_os_feature(p_feature); + +} + + String OS_Unix::get_installed_templates_path() const { String p=get_global_settings_path(); if (p!="") diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index b28adc2ee0..220f818ff6 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -117,6 +117,8 @@ public: virtual String get_executable_path() const; virtual String get_data_dir() const; + virtual bool check_feature_support(const String& p_feature); + //virtual void run( MainLoop * p_main_loop ); diff --git a/main/main.cpp b/main/main.cpp index 094b6aedae..3707c93fc5 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -130,7 +130,7 @@ void Main::print_help(const char* p_binary) { OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2017 Juan Linietsky, Ariel Manzur.\n"); OS::get_singleton()->print("Usage: %s [options] [scene]\n",p_binary); OS::get_singleton()->print("Options:\n"); - OS::get_singleton()->print("\t-path [dir] : Path to a game, containing engine.cfg\n"); + OS::get_singleton()->print("\t-path [dir] : Path to a game, containing godot.cfg\n"); #ifdef TOOLS_ENABLED OS::get_singleton()->print("\t-e,-editor : Bring up the editor instead of running the scene.\n"); #endif @@ -707,7 +707,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas else input_map->load_from_globals(); //keys for game - if (video_driver=="") // specified in engine.cfg + if (video_driver=="") // specified in godot.cfg video_driver=GLOBAL_DEF("display/driver/name",Variant((const char*)OS::get_singleton()->get_video_driver_name(0))); if (!force_res && use_custom_res && globals->has("display/window/width")) @@ -763,7 +763,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas /* Determine Video Driver */ - if (audio_driver=="") { // specified in engine.cfg + if (audio_driver=="") { // specified in godot.cfg audio_driver=GLOBAL_DEF("audio/driver",OS::get_singleton()->get_audio_driver_name(0)); } diff --git a/modules/etc1/image_etc.cpp b/modules/etc1/image_etc.cpp index 36ff1b86df..2d883bff0f 100644 --- a/modules/etc1/image_etc.cpp +++ b/modules/etc1/image_etc.cpp @@ -95,7 +95,7 @@ static void _decompress_etc(Image *p_img) { //print_line("Re Creating ETC into regular image: w "+itos(p_img->get_width())+" h "+itos(p_img->get_height())+" mm "+itos(p_img->get_mipmaps())); *p_img=Image(p_img->get_width(),p_img->get_height(),p_img->has_mipmaps(),Image::FORMAT_RGB8,dst); if (p_img->has_mipmaps()) - p_img->generate_mipmaps(true); + p_img->generate_mipmaps(); } @@ -112,16 +112,17 @@ static void _compress_etc(Image *p_img) { img.convert(Image::FORMAT_RGB8); - int mmc=img.get_mipmap_count(); - if (mmc==0) - img.generate_mipmaps(); // force mipmaps, so it works on most hardware - - PoolVector<uint8_t> res_data; PoolVector<uint8_t> dst_data; PoolVector<uint8_t>::Read r = img.get_data().read(); + int target_size = Image::get_image_data_size(p_img->get_width(),p_img->get_height(),Image::FORMAT_ETC,p_img->has_mipmaps()?-1:0); + int mmc = p_img->has_mipmaps() ? Image::get_image_required_mipmaps(p_img->get_width(),p_img->get_height(),Image::FORMAT_ETC) : 0; + + dst_data.resize(target_size); int mc=0; + int ofs=0; + PoolVector<uint8_t>::Write w=dst_data.write(); rg_etc1::etc1_pack_params pp; @@ -133,9 +134,9 @@ static void _compress_etc(Image *p_img) { int bh=MAX(imgh/4,1); const uint8_t *src = &r[img.get_mipmap_offset(i)]; int mmsize = MAX(bw,1)*MAX(bh,1)*8; - dst_data.resize(dst_data.size()+mmsize); - PoolVector<uint8_t>::Write w=dst_data.write(); - uint8_t *dst = &w[dst_data.size()-mmsize]; + + uint8_t *dst = &w[ofs]; + ofs+=mmsize; //print_line("bh: "+itos(bh)+" bw: "+itos(bw)); diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index a48c1f3485..28c200596b 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -64,10 +64,9 @@ void image_compress_squish(Image *p_image) { p_image->convert(Image::FORMAT_RGBA8); //always expects rgba - int mm_count = p_image->get_mipmap_count(); - PoolVector<uint8_t> data; - int target_size = Image::get_image_data_size(w,h,target_format,mm_count); + int target_size = Image::get_image_data_size(w,h,target_format,p_image->has_mipmaps()?-1:0); + int mm_count = p_image->has_mipmaps() ? Image::get_image_required_mipmaps(w,h,target_format) : 0; data.resize(target_size); PoolVector<uint8_t>::Read rb = p_image->get_data().read(); diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index b29ae211de..4c33590568 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -64,6 +64,18 @@ float GIProbeData::get_energy() const{ } +void GIProbeData::set_propagation(float p_range) { + + VS::get_singleton()->gi_probe_set_propagation(probe,p_range); +} + +float GIProbeData::get_propagation() const{ + + return VS::get_singleton()->gi_probe_get_propagation(probe); + +} + + void GIProbeData::set_interior(bool p_enable) { VS::get_singleton()->gi_probe_set_interior(probe,p_enable); @@ -121,6 +133,9 @@ void GIProbeData::_bind_methods() { ClassDB::bind_method(_MD("set_energy","energy"),&GIProbeData::set_energy); ClassDB::bind_method(_MD("get_energy"),&GIProbeData::get_energy); + ClassDB::bind_method(_MD("set_propagation","propagation"),&GIProbeData::set_propagation); + ClassDB::bind_method(_MD("get_propagation"),&GIProbeData::get_propagation); + ClassDB::bind_method(_MD("set_interior","interior"),&GIProbeData::set_interior); ClassDB::bind_method(_MD("is_interior"),&GIProbeData::is_interior); @@ -134,6 +149,7 @@ void GIProbeData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); ADD_PROPERTY(PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_energy"),_SCS("get_energy")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"propagation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_propagation"),_SCS("get_propagation")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"interior",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_interior"),_SCS("is_interior")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"compress",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_compress"),_SCS("is_compressed")); @@ -214,6 +230,18 @@ float GIProbe::get_energy() const { return energy; } +void GIProbe::set_propagation(float p_propagation) { + + propagation=p_propagation; + if (probe_data.is_valid()) { + probe_data->set_propagation(propagation); + } +} +float GIProbe::get_propagation() const { + + return propagation; +} + void GIProbe::set_interior(bool p_enable) { interior=p_enable; @@ -906,7 +934,7 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater } -void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker) { +void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker, const Vector<Ref<Material> > &p_materials, const Ref<Material> &p_override_material) { for(int i=0;i<p_mesh->get_surface_count();i++) { @@ -914,7 +942,16 @@ void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_b if (p_mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) continue; //only triangles - Baker::MaterialCache material = _get_material_cache(p_mesh->surface_get_material(i),p_baker); + Ref<Material> src_material; + + if (p_override_material.is_valid()) { + src_material=p_override_material; + } else if (i<p_materials.size() && p_materials[i].is_valid()) { + src_material=p_materials[i]; + } else { + src_material=p_mesh->surface_get_material(i); + } + Baker::MaterialCache material = _get_material_cache(src_material,p_baker); Array a = p_mesh->surface_get_arrays(i); @@ -1009,6 +1046,10 @@ void GIProbe::_find_meshes(Node *p_at_node,Baker *p_baker){ Baker::PlotMesh pm; pm.local_xform=xf; pm.mesh=mesh; + for(int i=0;i<mesh->get_surface_count();i++) { + pm.instance_materials.push_back(mi->get_surface_material(i)); + } + pm.override_material=mi->get_material_override(); p_baker->mesh_list.push_back(pm); } @@ -1083,7 +1124,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ print_line("plotting mesh "+itos(pmc++)+"/"+itos(baker.mesh_list.size())); - _plot_mesh(E->get().local_xform,E->get().mesh,&baker); + _plot_mesh(E->get().local_xform,E->get().mesh,&baker,E->get().instance_materials,E->get().override_material); } _fixup_plot(0,0,0,0,0,&baker); @@ -1358,6 +1399,9 @@ void GIProbe::_bind_methods() { ClassDB::bind_method(_MD("set_energy","max"),&GIProbe::set_energy); ClassDB::bind_method(_MD("get_energy"),&GIProbe::get_energy); + ClassDB::bind_method(_MD("set_propagation","max"),&GIProbe::set_propagation); + ClassDB::bind_method(_MD("get_propagation"),&GIProbe::get_propagation); + ClassDB::bind_method(_MD("set_interior","enable"),&GIProbe::set_interior); ClassDB::bind_method(_MD("is_interior"),&GIProbe::is_interior); @@ -1372,6 +1416,7 @@ void GIProbe::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"),_SCS("set_extents"),_SCS("get_extents")); ADD_PROPERTY( PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_RANGE,"1,16,1"),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_energy"),_SCS("get_energy")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"propagation",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_propagation"),_SCS("get_propagation")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"interior"),_SCS("set_interior"),_SCS("is_interior")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"compress"),_SCS("set_compress"),_SCS("is_compressed")); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"data",PROPERTY_HINT_RESOURCE_TYPE,"GIProbeData"),_SCS("set_probe_data"),_SCS("get_probe_data")); @@ -1389,6 +1434,7 @@ GIProbe::GIProbe() { subdiv=SUBDIV_128; dynamic_range=4; energy=1.0; + propagation=1.0; extents=Vector3(10,10,10); color_scan_cell_width=4; bake_texture_size=128; diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index e416b28791..f03a558908 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -32,6 +32,9 @@ public: void set_dynamic_range(int p_range); int get_dynamic_range() const; + void set_propagation(float p_range); + float get_propagation() const; + void set_energy(float p_range); float get_energy() const; @@ -114,6 +117,8 @@ private: int axis_cell_size[3]; struct PlotMesh { + Ref<Material> override_material; + Vector<Ref<Material> > instance_materials; Ref<Mesh> mesh; Transform local_xform; }; @@ -132,6 +137,7 @@ private: Vector3 extents; int dynamic_range; float energy; + float propagation; bool interior; bool compress; @@ -141,7 +147,7 @@ private: Vector<Color> _get_bake_texture(Image &p_image,const Color& p_color); Baker::MaterialCache _get_material_cache(Ref<Material> p_material,Baker *p_baker); void _plot_face(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const Rect3 &p_aabb,Baker *p_baker); - void _plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker); + void _plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker,const Vector<Ref<Material> >& p_materials,const Ref<Material>& p_override_material); void _find_meshes(Node *p_at_node,Baker *p_baker); void _fixup_plot(int p_idx, int p_level,int p_x,int p_y, int p_z,Baker *p_baker); @@ -170,6 +176,9 @@ public: void set_energy(float p_energy); float get_energy() const; + void set_propagation(float p_propagation); + float get_propagation() const; + void set_interior(bool p_enable); bool is_interior() const; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index a853b62254..fa89b7ba00 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -456,6 +456,26 @@ ImageTexture::~ImageTexture() { ////////////////////////////////////////// +void StreamTexture::_requested_3d(void* p_ud) { + + StreamTexture *st = (StreamTexture *)p_ud; + Ref<StreamTexture> stex(st); + ERR_FAIL_COND(!request_3d_callback); + request_3d_callback(stex); +} + +void StreamTexture::_requested_srgb(void* p_ud) { + + StreamTexture *st = (StreamTexture *)p_ud; + Ref<StreamTexture> stex(st); + ERR_FAIL_COND(!request_srgb_callback); + request_srgb_callback(stex); + +} + +StreamTexture::TextureFormatRequestCallback StreamTexture::request_3d_callback=NULL; +StreamTexture::TextureFormatRequestCallback StreamTexture::request_srgb_callback=NULL; + uint32_t StreamTexture::get_flags() const { @@ -490,6 +510,23 @@ Error StreamTexture::_load_data(const String& p_path,int &tw,int &th,int& flags, print_line("flags: "+itos(flags)); print_line("df: "+itos(df)); + + if (request_3d_callback && df&FORMAT_BIT_DETECT_3D) { + print_line("request detect 3D at "+p_path); + VS::get_singleton()->texture_set_detect_3d_callback(texture,_requested_3d,this); + } else { + print_line("not requesting detect 3D at "+p_path); + VS::get_singleton()->texture_set_detect_3d_callback(texture,NULL,NULL); + } + + if (request_srgb_callback && df&FORMAT_BIT_DETECT_SRGB) { + print_line("request detect srgb at "+p_path); + VS::get_singleton()->texture_set_detect_srgb_callback(texture,_requested_srgb,this); + } else { + VS::get_singleton()->texture_set_detect_srgb_callback(texture,NULL,NULL); + print_line("not requesting detect srgb at "+p_path); + } + if (!(df&FORMAT_BIT_STREAM)) { p_size_limit=0; } @@ -635,6 +672,7 @@ Error StreamTexture::_load_data(const String& p_path,int &tw,int &th,int& flags, { PoolVector<uint8_t>::Write w=img_data.write(); int bytes = f->get_buffer(w.ptr(),total_size - ofs); + print_line("requested read: "+itos(total_size - ofs)+" but got: "+itos(bytes)); memdelete(f); @@ -722,6 +760,12 @@ void StreamTexture::set_flags(uint32_t p_flags){ void StreamTexture::reload_from_file() { +#ifdef TOOLS_ENABLED + String ipath = get_import_path(); + if (ipath.is_resource_file() && ipath!=path_to_file) { + path_to_file=ipath; + } +#endif load(path_to_file); } diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 919c588894..f684aeb658 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -178,6 +178,8 @@ public: FORMAT_BIT_LOSSY=1<<21, FORMAT_BIT_STREAM=1<<22, FORMAT_BIT_HAS_MIPMAPS=1<<23, + FORMAT_BIT_DETECT_3D=1<<24, + FORMAT_BIT_DETECT_SRGB=1<<25, }; private: @@ -191,6 +193,9 @@ private: virtual void reload_from_file(); + static void _requested_3d(void* p_ud); + static void _requested_srgb(void* p_ud); + protected: static void _bind_methods(); @@ -198,6 +203,11 @@ protected: public: + typedef void (*TextureFormatRequestCallback)(const Ref<StreamTexture>&); + + static TextureFormatRequestCallback request_3d_callback; + static TextureFormatRequestCallback request_srgb_callback; + uint32_t get_flags() const; Image::Format get_format() const; Error load(const String& p_path); diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 44bc9bfef5..21f7f0769f 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -196,6 +196,8 @@ public: virtual RID texture_create_radiance_cubemap(RID p_source,int p_resolution=-1) const=0; + virtual void texture_set_detect_3d_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata)=0; + virtual void texture_set_detect_srgb_callback(RID p_texture,VisualServer::TextureDetectCallback p_callback,void* p_userdata)=0; virtual void textures_keep_original(bool p_enable)=0; @@ -430,6 +432,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; virtual float gi_probe_get_energy(RID p_probe) const=0; + virtual void gi_probe_set_propagation(RID p_probe,float p_range)=0; + virtual float gi_probe_get_propagation(RID p_probe) const=0; + virtual void gi_probe_set_interior(RID p_probe,bool p_enable)=0; virtual bool gi_probe_is_interior(RID p_probe) const=0; @@ -512,6 +517,7 @@ public: virtual VS::InstanceType get_base_type(RID p_rid) const=0; virtual bool free(RID p_rid)=0; + virtual bool has_os_feature(const String& p_feature) const=0; static RasterizerStorage*base_signleton; RasterizerStorage(); diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 279da9149e..8f87425212 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -157,6 +157,12 @@ RID VisualServerRaster::get_test_cube() { return test_cube; } + +bool VisualServerRaster::has_os_feature(const String& p_feature) const { + + return VSG::storage->has_os_feature(p_feature); +} + VisualServerRaster::VisualServerRaster() { VSG::canvas = memnew( VisualServerCanvas); diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 5c8105681a..ad0cb664c5 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -622,7 +622,8 @@ public: BIND3(texture_set_size_override,RID,int,int) BIND2RC(RID,texture_create_radiance_cubemap,RID,int) - + BIND3(texture_set_detect_3d_callback,RID,TextureDetectCallback,void*) + BIND3(texture_set_detect_srgb_callback,RID,TextureDetectCallback,void*) BIND2(texture_set_path,RID,const String&) BIND1RC(String,texture_get_path,RID) @@ -824,6 +825,9 @@ public: BIND2(gi_probe_set_energy,RID,float) BIND1RC(float,gi_probe_get_energy,RID) + BIND2(gi_probe_set_propagation,RID,float) + BIND1RC(float,gi_probe_get_propagation,RID) + BIND2(gi_probe_set_interior,RID,bool) BIND1RC(bool,gi_probe_is_interior,RID) @@ -1135,6 +1139,8 @@ public: virtual bool has_feature(Features p_feature) const; + virtual bool has_os_feature(const String& p_feature) const; + VisualServerRaster(); ~VisualServerRaster(); diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 157a85be98..297413effd 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -2239,7 +2239,6 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform,const Came bool redraw = VSG::scene_render->shadow_atlas_update_light(p_shadow_atlas,light->instance,coverage,light->last_version); if (redraw) { - print_line("redraw shadow"); //must redraw! _light_instance_update_shadow(ins,p_cam_transform,p_cam_projection,p_cam_orthogonal,p_shadow_atlas,scenario); } @@ -2448,6 +2447,7 @@ void VisualServerScene::_setup_gi_probe(Instance *p_instance) { probe->dynamic.bake_dynamic_range=VSG::storage->gi_probe_get_dynamic_range(p_instance->base); probe->dynamic.mipmaps_3d.clear(); + probe->dynamic.propagate=VSG::storage->gi_probe_get_propagation(p_instance->base); probe->dynamic.grid_size[0]=header->width; probe->dynamic.grid_size[1]=header->height; @@ -2942,14 +2942,12 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header,con } -void VisualServerScene::_bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data) { +void VisualServerScene::_bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data,float p_propagate) { //average light to upper level - p_local_data[p_idx].energy[0]=0; - p_local_data[p_idx].energy[1]=0; - p_local_data[p_idx].energy[2]=0; - int divisor=0; + float divisor=0; + float sum[3]={0.0,0.0,0.0}; for(int i=0;i<8;i++) { @@ -2959,20 +2957,25 @@ void VisualServerScene::_bake_gi_downscale_light(int p_idx, int p_level, const G continue; if (p_level+1 < (int)p_header->cell_subdiv-1) { - _bake_gi_downscale_light(child,p_level+1,p_cells,p_header,p_local_data); + _bake_gi_downscale_light(child,p_level+1,p_cells,p_header,p_local_data,p_propagate); } - p_local_data[p_idx].energy[0]+=p_local_data[child].energy[0]; - p_local_data[p_idx].energy[1]+=p_local_data[child].energy[1]; - p_local_data[p_idx].energy[2]+=p_local_data[child].energy[2]; - divisor++; + sum[0]+=p_local_data[child].energy[0]; + sum[1]+=p_local_data[child].energy[1]; + sum[2]+=p_local_data[child].energy[2]; + divisor+=1.0; } + divisor=Math::lerp(8.0,divisor,p_propagate); + sum[0]/=divisor; + sum[1]/=divisor; + sum[2]/=divisor; + //divide by eight for average - p_local_data[p_idx].energy[0]/=divisor; - p_local_data[p_idx].energy[1]/=divisor; - p_local_data[p_idx].energy[2]/=divisor; + p_local_data[p_idx].energy[0]=Math::fast_ftoi(sum[0]); + p_local_data[p_idx].energy[1]=Math::fast_ftoi(sum[1]); + p_local_data[p_idx].energy[2]=Math::fast_ftoi(sum[2]); } @@ -3024,7 +3027,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { SWAP(probe_data->dynamic.light_cache_changes,probe_data->dynamic.light_cache); //downscale to lower res levels - _bake_gi_downscale_light(0,0,cells,header,local_data); + _bake_gi_downscale_light(0,0,cells,header,local_data,probe_data->dynamic.propagate); //plot result to 3D texture! @@ -3337,6 +3340,14 @@ void VisualServerScene::render_probes() { force_lighting=true; } + float propagate = VSG::storage->gi_probe_get_propagation(instance_probe->base); + + if (probe->dynamic.propagate!=propagate) { + probe->dynamic.propagate=propagate; + force_lighting=true; + } + + if (probe->invalid==false && probe->dynamic.enabled) { switch(probe->dynamic.updating_stage) { diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index 1f7de3d005..f9a5dde1ac 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -445,6 +445,7 @@ public: Vector< PoolVector<CompBlockS3TC> > mipmaps_s3tc; //for s3tc int updating_stage; + float propagate; int grid_size[3]; @@ -570,7 +571,7 @@ public: void _gi_probe_fill_local_data(int p_idx,int p_level,int p_x,int p_y,int p_z,const GIProbeDataCell* p_cell,const GIProbeDataHeader *p_header,InstanceGIProbeData::LocalData *p_local_data,Vector<uint32_t> *prev_cell); _FORCE_INLINE_ uint32_t _gi_bake_find_cell(const GIProbeDataCell *cells,int x,int y, int z,int p_cell_subdiv); - void _bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data); + void _bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data, float p_propagate); void _bake_gi_probe_light(const GIProbeDataHeader *header,const GIProbeDataCell *cells,InstanceGIProbeData::LocalData *local_data,const uint32_t *leaves,int p_leaf_count, const InstanceGIProbeData::LightCache& light_cache,int p_sign); void _bake_gi_probe(Instance *p_probe); bool _check_gi_probe(Instance *p_gi_probe); diff --git a/servers/visual_server.h b/servers/visual_server.h index f75223e378..cda7721653 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -129,6 +129,11 @@ public: virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable)=0; + typedef void (*TextureDetectCallback)(void*); + + virtual void texture_set_detect_3d_callback(RID p_texture,TextureDetectCallback p_callback,void* p_userdata)=0; + virtual void texture_set_detect_srgb_callback(RID p_texture,TextureDetectCallback p_callback,void* p_userdata)=0; + struct TextureInfo { RID texture; Size2 size; @@ -469,6 +474,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; virtual float gi_probe_get_energy(RID p_probe) const=0; + virtual void gi_probe_set_propagation(RID p_probe,float p_range)=0; + virtual float gi_probe_get_propagation(RID p_probe) const=0; + virtual void gi_probe_set_interior(RID p_probe,bool p_enable)=0; virtual bool gi_probe_is_interior(RID p_probe) const=0; @@ -938,6 +946,8 @@ public: virtual bool has_feature(Features p_feature) const=0; + virtual bool has_os_feature(const String& p_feature) const=0; + VisualServer(); virtual ~VisualServer(); diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp index 1d7d58591c..c7b50a3c09 100644 --- a/tools/editor/editor_file_system.cpp +++ b/tools/editor/editor_file_system.cpp @@ -544,7 +544,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess if (f.begins_with(".")) //ignore hidden and . / .. continue; - if (FileAccess::exists(cd.plus_file(f).plus_file("engine.cfg"))) // skip if another project inside this + if (FileAccess::exists(cd.plus_file(f).plus_file("godot.cfg"))) // skip if another project inside this continue; dirs.push_back(f); @@ -630,6 +630,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess import_mt=FileAccess::get_modified_time(path+".import"); } + if (fc && fc->modification_time==mt && fc->import_modification_time==import_mt && _check_missing_imported_files(path)) { fi->type=fc->type; @@ -638,7 +639,20 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess } else { - print_line("REIMPORT BECAUSE: time changed"); + if (!fc) { + print_line("REIMPORT BECAUSE: not previously found"); + } else if (fc->modification_time!=mt) { + print_line("REIMPORT BECAUSE: modified resource time "+itos(fc->modification_time)+" vs "+itos(mt)); + + } else if (fc->import_modification_time!=import_mt) { + print_line("REIMPORT BECAUSE: modified .import time"+itos(fc->import_modification_time)+" vs "+itos(import_mt)); + + } else { + + print_line("REIMPORT BECAUSE: missing imported files"); + } + + fi->type=ResourceFormatImporter::get_singleton()->get_resource_type(path); fi->modified_time=0; fi->import_modified_time=0; @@ -719,7 +733,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S int idx = p_dir->find_dir_index(f); if (idx==-1) { - if (FileAccess::exists(cd.plus_file(f).plus_file("engine.cfg"))) // skip if another project inside this + if (FileAccess::exists(cd.plus_file(f).plus_file("godot.cfg"))) // skip if another project inside this continue; EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory ); @@ -774,6 +788,10 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S if (import_extensions.has(ext)) { //if it can be imported, and it was added, it needs to be reimported print_line("REIMPORT: file was not found before, reimport"); + print_line("at dir: "+p_dir->get_path()+" file: "+f); + for(int i=0;i<p_dir->files.size();i++) { + print_line(itos(i)+": "+p_dir->files[i]->file); + } ItemAction ia; ia.action=ItemAction::ACTION_FILE_REIMPORT; ia.dir=p_dir; @@ -826,6 +844,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S } else { uint64_t import_mt=FileAccess::get_modified_time(path+".import"); + print_line(itos(import_mt)+" vs "+itos(p_dir->files[i]->import_modified_time)); if (import_mt!=p_dir->files[i]->import_modified_time) { print_line("REIMPORT: import modified changed, reimport"); reimport=true; @@ -1009,7 +1028,7 @@ void EditorFileSystem::_notification(int p_what) { bool EditorFileSystem::is_scanning() const { - return scanning; + return scanning || scanning_changes; } float EditorFileSystem::get_scanning_progress() const { @@ -1079,6 +1098,8 @@ bool EditorFileSystem::_find_file(const String& p_file,EditorFileSystemDirectory for(int i=0;i<path.size();i++) { + if (path[i].begins_with(".")) + return false; int idx=-1; for(int j=0;j<fs->get_subdir_count();j++) { @@ -1266,6 +1287,7 @@ void EditorFileSystem::update_file(const String& p_file) { EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo ); fi->file=p_file.get_file(); + fi->import_modified_time=0; if (idx==fs->files.size()) { fs->files.push_back(fi); @@ -1281,7 +1303,9 @@ void EditorFileSystem::update_file(const String& p_file) { //print_line("UPDATING: "+p_file); fs->files[cpos]->type=type; fs->files[cpos]->modified_time=FileAccess::get_modified_time(p_file); - fs->files[cpos]->import_modified_time=0; + //if (FileAccess::exists(p_file+".import")) { + // fs->files[cpos]->import_modified_time=FileAccess::get_modified_time(p_file+".import"); + //} EditorResourcePreview::get_singleton()->call_deferred("check_for_invalidation",p_file); call_deferred("emit_signal","filesystem_changed"); //update later @@ -1369,6 +1393,7 @@ void EditorFileSystem::_reimport_file(const String& p_file) { f->store_line("type=\""+importer->get_resource_type()+"\""); } + if (importer->get_save_extension()=="") { //no path } else if (import_variants.size()) { @@ -1376,7 +1401,10 @@ void EditorFileSystem::_reimport_file(const String& p_file) { for(List<String>::Element *E=import_variants.front();E;E=E->next()) { - f->store_line("path."+E->get()+"=\""+base_path.c_escape()+"."+E->get()+"."+importer->get_save_extension()+"\""); + String path = base_path.c_escape()+"."+E->get()+"."+importer->get_save_extension(); + + f->store_line("path."+E->get()+"=\""+path+"\""); + } } else { @@ -1402,6 +1430,8 @@ void EditorFileSystem::_reimport_file(const String& p_file) { f->store_line(""); //store options in provided order, to avoid file changing + + for (List<ResourceImporter::ImportOption>::Element *E=opts.front();E;E=E->next()) { String base = E->get().option.name; @@ -1412,16 +1442,31 @@ void EditorFileSystem::_reimport_file(const String& p_file) { } + f->close(); memdelete(f); //update modified times, to avoid reimport fs->files[cpos]->modified_time = FileAccess::get_modified_time(p_file); fs->files[cpos]->import_modified_time = FileAccess::get_modified_time(p_file+".import"); + + //if file is currently up, maybe the source it was loaded from changed, so import math must be updated for it + //to reload properly + if (ResourceCache::has(p_file)) { + + Resource *r = ResourceCache::get(p_file); + + if (r->get_import_path()!=String()) { + + String dst_path = ResourceFormatImporter::get_singleton()->get_internal_resource_path(p_file); + r->set_import_path(dst_path); + r->set_import_last_modified_time(0); + } + } } void EditorFileSystem::reimport_files(const Vector<String>& p_files) { - + importing=true; EditorProgress pr("reimport",TTR("(Re)Importing Assets"),p_files.size()); for(int i=0;i<p_files.size();i++) { pr.step(p_files[i].get_file(),i); @@ -1430,6 +1475,10 @@ void EditorFileSystem::reimport_files(const Vector<String>& p_files) { } _save_filesystem_cache(); + importing=false; + if (!is_scanning()) { + emit_signal("filesystem_changed"); + } } void EditorFileSystem::_bind_methods() { @@ -1478,6 +1527,7 @@ EditorFileSystem::EditorFileSystem() { thread = NULL; scanning=false; + importing=false; use_threads=true; thread_sources=NULL; new_filesystem=NULL; diff --git a/tools/editor/editor_file_system.h b/tools/editor/editor_file_system.h index 92169907a4..10d9b919fc 100644 --- a/tools/editor/editor_file_system.h +++ b/tools/editor/editor_file_system.h @@ -133,6 +133,7 @@ class EditorFileSystem : public Node { bool abort_scan; bool scanning; + bool importing; float scan_total; @@ -210,6 +211,7 @@ public: EditorFileSystemDirectory *get_filesystem(); bool is_scanning() const; + bool is_importing() const { return importing; } float get_scanning_progress() const; void scan(); void scan_changes(); diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index b79bf7042b..69a004fc08 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -390,8 +390,8 @@ Vector<StringName> EditorExportPlatform::get_dependencies(bool p_bundles) const Set<StringName> exported; - if (FileAccess::exists("res://engine.cfg")) - exported.insert("res://engine.cfg"); + if (FileAccess::exists("res://godot.cfg")) + exported.insert("res://godot.cfg"); if (EditorImportExport::get_singleton()->get_export_filter()!=EditorImportExport::EXPORT_SELECTED) { @@ -987,7 +987,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func } - StringName engine_cfg="res://engine.cfg"; + StringName engine_cfg="res://godot.cfg"; StringName boot_splash; { String splash=GlobalConfig::get_singleton()->get("application/boot_splash"); //avoid splash from being converted @@ -1041,7 +1041,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func { - //make binary engine.cfg config + //make binary godot.cfg config Map<String,Variant> custom; @@ -1085,7 +1085,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func } - String remap_file="engine.cfb"; + String remap_file="godot.cfb"; String engine_cfb =EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmp"+remap_file; GlobalConfig::get_singleton()->save_custom(engine_cfb,custom); Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb); diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 9607ee9876..352b0818b4 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -103,6 +103,7 @@ #include "import/resource_importer_csv_translation.h" #include "import/resource_importer_wav.h" #include "import/resource_importer_obj.h" +#include "import/resource_importer_scene.h" // end #include "editor_settings.h" #include "io_plugins/editor_texture_import_plugin.h" @@ -113,7 +114,7 @@ #include "io_plugins/editor_bitmask_import_plugin.h" #include "io_plugins/editor_mesh_import_plugin.h" #include "io_plugins/editor_export_scene.h" -#include "io_plugins/editor_import_collada.h" +#include "import/editor_import_collada.h" #include "io_plugins/editor_scene_importer_fbxconv.h" #include "plugins/editor_preview_plugins.h" @@ -307,6 +308,8 @@ void EditorNode::_notification(int p_what) { } + ResourceImporterTexture::get_singleton()->update_imports(); + } if (p_what==NOTIFICATION_ENTER_TREE) { @@ -410,8 +413,10 @@ void EditorNode::_fs_changed() { if (E->get()->get_import_path()!=String()) { //imported resource uint64_t mt = FileAccess::get_modified_time(E->get()->get_import_path()); + print_line("testing modified: "+E->get()->get_import_path()+" "+itos(mt)+" vs "+itos(E->get()->get_import_last_modified_time())); if (mt!=E->get()->get_import_last_modified_time()) { + print_line("success"); changed.push_back(E->get()); } @@ -3303,7 +3308,10 @@ void EditorNode::fix_dependencies(const String& p_for_file) { dependency_fixer->edit(p_for_file); } -Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bool p_set_inherited,bool p_clear_errors) { + + + +Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps, bool p_set_inherited, bool p_clear_errors, bool p_force_open_imported) { if (!is_inside_tree()) { defer_load_scene = p_scene; @@ -3312,6 +3320,8 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo if(!p_set_inherited) { + + for(int i=0;i<editor_data.get_edited_scene_count();i++) { if (editor_data.get_scene_path(i)==p_scene) { @@ -3319,9 +3329,19 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo return OK; } } + + if (!p_force_open_imported && FileAccess::exists(p_scene+".import")) { + open_imported->set_text(vformat(TTR("Scene '%s' was automatically imported, so it can't be modified.\nTo make changes to it, a new inherited scene can be created."),p_scene.get_file())); + open_imported->popup_centered_minsize(); + new_inherited_button->grab_focus(); + open_import_request=p_scene; + return OK; + } + } + if (p_clear_errors) load_errors->clear(); @@ -4957,6 +4977,19 @@ void EditorNode::_call_build() { } } + +void EditorNode::_inherit_imported(const String& p_action) { + + open_imported->hide(); + load_scene(open_import_request,true,true); + +} + +void EditorNode::_open_imported() { + + load_scene(open_import_request,true,false,true,true); +} + void EditorNode::_bind_methods() { @@ -5034,6 +5067,8 @@ void EditorNode::_bind_methods() { ClassDB::bind_method(_MD("get_gui_base"), &EditorNode::get_gui_base); ClassDB::bind_method(_MD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch); + ClassDB::bind_method(_MD("_open_imported"), &EditorNode::_open_imported); + ClassDB::bind_method(_MD("_inherit_imported"), &EditorNode::_inherit_imported); ADD_SIGNAL( MethodInfo("play_pressed") ); ADD_SIGNAL( MethodInfo("pause_pressed") ); @@ -5137,6 +5172,16 @@ EditorNode::EditorNode() { import_obj.instance(); ResourceFormatImporter::get_singleton()->add_importer(import_obj); + Ref<ResourceImporterScene> import_scene; + import_scene.instance(); + ResourceFormatImporter::get_singleton()->add_importer(import_scene); + + { + Ref<EditorSceneImporterCollada> import_collada; + import_collada.instance(); + import_scene->add_importer(import_collada); + } + } _pvrtc_register_compressors(); @@ -6346,6 +6391,14 @@ EditorNode::EditorNode() { } } + open_imported = memnew( ConfirmationDialog ); + open_imported->get_ok()->set_text(TTR("Open Anyway")); + new_inherited_button=open_imported->add_button("New Inherited",!OS::get_singleton()->get_swap_ok_cancel(),"inherit"); + open_imported->connect("confirmed",this,"_open_imported"); + open_imported->connect("custom_action",this,"_inherit_imported"); + gui_base->add_child(open_imported); + + //edited_scene=NULL; saved_version=1; diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 785136a968..4aca433f9c 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -346,6 +346,10 @@ private: DependencyErrorDialog *dependency_error; DependencyEditor *dependency_fixer; OrphanResourcesDialog *orphan_resources; + ConfirmationDialog *open_imported; + Button *new_inherited_button; + String open_import_request; + TabContainer *dock_slot[DOCK_SLOT_MAX]; Rect2 dock_select_rect[DOCK_SLOT_MAX]; @@ -584,6 +588,8 @@ private: MAX_BUILD_CALLBACKS=128 }; + void _inherit_imported(const String &p_action); + void _open_imported(); static int plugin_init_callback_count; @@ -684,7 +690,7 @@ public: void fix_dependencies(const String& p_for_file); void clear_scene() { _cleanup_scene(); } - Error load_scene(const String& p_scene, bool p_ignore_broken_deps=false, bool p_set_inherited=false, bool p_clear_errors=true); + Error load_scene(const String& p_scene, bool p_ignore_broken_deps=false, bool p_set_inherited=false, bool p_clear_errors=true,bool p_force_open_imported=false); Error load_resource(const String& p_scene); bool is_scene_open(const String& p_path); diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/import/editor_import_collada.cpp index 963347f18b..4d99389f9b 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/import/editor_import_collada.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "editor_import_collada.h" -#if 0 + #include "collada/collada.h" #include "scene/3d/spatial.h" #include "scene/3d/skeleton.h" @@ -65,6 +65,7 @@ struct ColladaImport { bool found_directional; bool force_make_tangents; bool apply_mesh_xform_to_vertices; + bool use_mesh_builtin_materials; float bake_fps; @@ -87,7 +88,7 @@ struct ColladaImport { Error _create_scene(Collada::Node *p_node, Spatial *p_parent); Error _create_resources(Collada::Node *p_node); Error _create_material(const String& p_material); - Error _create_mesh_surfaces(bool p_optimize, Ref<Mesh>& p_mesh, const Map<String,Collada::NodeGeometry::Material>& p_material_map, const Collada::MeshData &meshdata, const Transform& p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_data, const Collada::MorphControllerData *p_morph_data, Vector<Ref<Mesh> > p_morph_meshes=Vector<Ref<Mesh> >(), bool p_for_morph=false); + Error _create_mesh_surfaces(bool p_optimize, Ref<Mesh>& p_mesh, const Map<String,Collada::NodeGeometry::Material>& p_material_map, const Collada::MeshData &meshdata, const Transform& p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_data, const Collada::MorphControllerData *p_morph_data, Vector<Ref<Mesh> > p_morph_meshes=Vector<Ref<Mesh> >(), bool p_for_morph=false, bool p_use_mesh_material=false); Error load(const String& p_path, int p_flags, bool p_force_make_tangents=false); void _fix_param_animation_tracks(); void create_animation(int p_clip,bool p_make_tracks_in_all_bones, bool p_import_value_tracks); @@ -429,9 +430,10 @@ Error ColladaImport::_create_material(const String& p_target) { } } else { - //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,effect.specular.color); + material->set_metalness(effect.specular.color.get_v()); } + // EMISSION if (effect.emission.texture!="") { @@ -442,17 +444,21 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { + material->set_feature(FixedSpatialMaterial::FEATURE_EMISSION,true); material->set_texture(FixedSpatialMaterial::TEXTURE_EMISSION,texture); material->set_emission(Color(1,1,1,1)); //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,Color(1,1,1,1)); }else { - //missing_textures.push_back(texfile.get_file()); + missing_textures.push_back(texfile.get_file()); } } } else { - //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,effect.emission.color); + if (effect.emission.color!=Color()) { + material->set_feature(FixedSpatialMaterial::FEATURE_EMISSION,true); + material->set_emission(effect.emission.color); + } } // NORMAL @@ -464,6 +470,7 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { + material->set_feature(FixedSpatialMaterial::FEATURE_NORMAL_MAPPING,true); material->set_texture(FixedSpatialMaterial::TEXTURE_NORMAL,texture); //material->set_emission(Color(1,1,1,1)); @@ -476,7 +483,9 @@ Error ColladaImport::_create_material(const String& p_target) { } - //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,effect.shininess); + float roughness = Math::sqrt(1.0-((Math::log(effect.shininess)/Math::log(2.0))/8.0)); //not very right.. + material->set_roughness(roughness); + if (effect.double_sided) { material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); } @@ -610,7 +619,7 @@ static void _generate_tangents_and_binormals(const PoolVector<int>& p_indices,co } } -Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,const Map<String,Collada::NodeGeometry::Material>& p_material_map,const Collada::MeshData &meshdata,const Transform& p_local_xform,const Vector<int> &bone_remap, const Collada::SkinControllerData *skin_controller, const Collada::MorphControllerData *p_morph_data,Vector<Ref<Mesh> > p_morph_meshes,bool p_for_morph) { +Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,const Map<String,Collada::NodeGeometry::Material>& p_material_map,const Collada::MeshData &meshdata,const Transform& p_local_xform,const Vector<int> &bone_remap, const Collada::SkinControllerData *skin_controller, const Collada::MorphControllerData *p_morph_data,Vector<Ref<Mesh> > p_morph_meshes,bool p_for_morph,bool p_use_mesh_material) { bool local_xform_mirror=p_local_xform.basis.determinant() < 0; @@ -1494,7 +1503,9 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con p_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,d,mr,p_for_morph?0:Mesh::ARRAY_COMPRESS_DEFAULT); if (material.is_valid()) { - p_mesh->surface_set_material(surface, material); + if (p_use_mesh_material) { + p_mesh->surface_set_material(surface, material); + } p_mesh->surface_set_name(surface, material->get_name()); } } @@ -1753,7 +1764,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) { mesh=Ref<Mesh>(memnew( Mesh )); const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid]; mesh->set_name( meshdata.name ); - Error err = _create_mesh_surfaces(morphs.size()==0,mesh,ng->material_map,meshdata,apply_xform,bone_remap,skin,morph,morphs); + Error err = _create_mesh_surfaces(morphs.size()==0,mesh,ng->material_map,meshdata,apply_xform,bone_remap,skin,morph,morphs,false,use_mesh_builtin_materials); ERR_FAIL_COND_V(err,err); mesh_cache[meshid]=mesh; @@ -1764,7 +1775,33 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) { } if (!mesh.is_null()) { + mi->set_mesh(mesh); + if (!use_mesh_builtin_materials) { + const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid]; + + for(int i=0;i<meshdata.primitives.size();i++) { + + String matname=meshdata.primitives[i].material; + + if (ng->material_map.has(matname)) { + String target=ng->material_map[matname].target; + + Ref<Material> material; + if (!material_cache.has(target)) { + Error err = _create_material(target); + if (!err) + material=material_cache[target]; + } else + material=material_cache[target]; + + mi->set_surface_material(i,material); + } else if (matname!=""){ + print_line("Warning, unreferenced material in geometry instance: "+matname); + } + + } + } } } } @@ -2375,6 +2412,7 @@ Node* EditorSceneImporterCollada::import_scene(const String& p_path, uint32_t p_ if (p_flags&IMPORT_ANIMATION) flags|=Collada::IMPORT_FLAG_ANIMATION; + state.use_mesh_builtin_materials=!(p_flags&IMPORT_MATERIALS_IN_INSTANCES); state.bake_fps=p_bake_fps; Error err = state.load(p_path,flags,p_flags&EditorSceneImporter::IMPORT_GENERATE_TANGENT_ARRAYS); @@ -2435,6 +2473,8 @@ Ref<Animation> EditorSceneImporterCollada::import_animation(const String& p_path ColladaImport state; + state.use_mesh_builtin_materials=false; + Error err = state.load(p_path,Collada::IMPORT_FLAG_ANIMATION,p_flags&EditorSceneImporter::IMPORT_GENERATE_TANGENT_ARRAYS); ERR_FAIL_COND_V(err!=OK,RES()); @@ -2465,4 +2505,4 @@ EditorSceneImporterCollada::EditorSceneImporterCollada() { } -#endif + diff --git a/tools/editor/io_plugins/editor_import_collada.h b/tools/editor/import/editor_import_collada.h index c325b58e32..cd3614bb40 100644 --- a/tools/editor/io_plugins/editor_import_collada.h +++ b/tools/editor/import/editor_import_collada.h @@ -29,9 +29,9 @@ #ifndef EDITOR_IMPORT_COLLADA_H #define EDITOR_IMPORT_COLLADA_H -#include "tools/editor/io_plugins/editor_scene_import_plugin.h" +#include "tools/editor/import/resource_importer_scene.h" + -#if 0 class EditorSceneImporterCollada : public EditorSceneImporter { @@ -46,6 +46,6 @@ public: EditorSceneImporterCollada(); }; -#endif + #endif diff --git a/tools/editor/import/resource_importer_scene.cpp b/tools/editor/import/resource_importer_scene.cpp new file mode 100644 index 0000000000..ae840e9e16 --- /dev/null +++ b/tools/editor/import/resource_importer_scene.cpp @@ -0,0 +1,1328 @@ +#include "resource_importer_scene.h" + +#include "scene/resources/packed_scene.h" +#include "io/resource_saver.h" +#include "tools/editor/editor_node.h" + +#include "scene/3d/mesh_instance.h" +#include "scene/3d/navigation.h" +#include "scene/3d/room_instance.h" +#include "scene/3d/body_shape.h" +#include "scene/3d/physics_body.h" +#include "scene/3d/portal.h" +#include "scene/3d/vehicle_body.h" +#include "scene/resources/sphere_shape.h" +#include "scene/resources/box_shape.h" +#include "scene/resources/ray_shape.h" +#include "scene/resources/plane_shape.h" + + +void EditorScenePostImport::_bind_methods() { + + BIND_VMETHOD( MethodInfo("post_import",PropertyInfo(Variant::OBJECT,"scene")) ); + +} + +Node *EditorScenePostImport::post_import(Node* p_scene) { + + if (get_script_instance()) + return get_script_instance()->call("post_import",p_scene); + + return p_scene; +} + +EditorScenePostImport::EditorScenePostImport() { + + +} + + +String ResourceImporterScene::get_importer_name() const { + + return "scene"; +} + +String ResourceImporterScene::get_visible_name() const{ + + return "Scene"; +} + +void ResourceImporterScene::get_recognized_extensions(List<String> *p_extensions) const{ + + for (Set< Ref<EditorSceneImporter> >::Element *E=importers.front();E;E=E->next()) { + E->get()->get_extensions(p_extensions); + } +} + +String ResourceImporterScene::get_save_extension() const { + return "scn"; +} + +String ResourceImporterScene::get_resource_type() const{ + + return "PackedScene"; +} + +bool ResourceImporterScene::get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const { + + if (p_option.begins_with("animation/")) { + if (p_option!="animation/import" && !bool(p_options["animation/import"])) + return false; + + if (p_option.begins_with("animation/optimizer/") && p_option!="animation/optimizer/enabled" && !bool(p_options["animation/optimizer/enabled"])) + return false; + + if (p_option.begins_with("animation/clip_")) { + int max_clip = p_options["animation/clips/amount"]; + int clip = p_option.get_slice("/",1).get_slice("_",1).to_int()-1; + if (clip>=max_clip) + return false; + } + } + + return true; + +} + +int ResourceImporterScene::get_preset_count() const { + return 0; +} +String ResourceImporterScene::get_preset_name(int p_idx) const { + + return ""; +} + + +static bool _teststr(const String& p_what,const String& p_str) { + + if (p_what.findn("$"+p_str)!=-1) //blender and other stuff + return true; + if (p_what.to_lower().ends_with("-"+p_str)) //collada only supports "_" and "-" besides letters + return true; + if (p_what.to_lower().ends_with("_"+p_str)) //collada only supports "_" and "-" besides letters + return true; + return false; +} + +static String _fixstr(const String& p_what,const String& p_str) { + + if (p_what.findn("$"+p_str)!=-1) //blender and other stuff + return p_what.replace("$"+p_str,""); + if (p_what.to_lower().ends_with("-"+p_str)) //collada only supports "_" and "-" besides letters + return p_what.substr(0,p_what.length()-(p_str.length()+1)); + if (p_what.to_lower().ends_with("_"+p_str)) //collada only supports "_" and "-" besides letters + return p_what.substr(0,p_what.length()-(p_str.length()+1)); + return p_what; +} + + +Node* ResourceImporterScene::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>,Ref<Shape> > &collision_map) { + + // children first.. + for(int i=0;i<p_node->get_child_count();i++) { + + + Node *r = _fix_node(p_node->get_child(i),p_root,collision_map); + if (!r) { + print_line("was erased.."); + i--; //was erased + } + } + + String name = p_node->get_name(); + + bool isroot = p_node==p_root; + + + if (!isroot && _teststr(name,"noimp")) { + + memdelete(p_node); + return NULL; + } + + + if (p_node->cast_to<MeshInstance>()) { + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + + bool bb=false; + + if ((_teststr(name,"bb"))) { + bb=true; + } else if (mi->get_mesh().is_valid() && (_teststr(mi->get_mesh()->get_name(),"bb"))) { + bb=true; + + } + + if (bb) { + mi->set_flag(GeometryInstance::FLAG_BILLBOARD,true); + if (mi->get_mesh().is_valid()) { + + Ref<Mesh> m = mi->get_mesh(); + for(int i=0;i<m->get_surface_count();i++) { + + Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); + if (fm.is_valid()) { + //fm->set_flag(Material::FLAG_UNSHADED,true); + //fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); + //fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); + //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + } + } + } + } + } + + + if (p_node->cast_to<MeshInstance>()) { + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + + Ref<Mesh> m = mi->get_mesh(); + + if (m.is_valid()) { + + for(int i=0;i<m->get_surface_count();i++) { + + Ref<FixedSpatialMaterial> mat = m->surface_get_material(i); + if (!mat.is_valid()) + continue; + + if (_teststr(mat->get_name(),"alpha")) { + + mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true); + mat->set_name(_fixstr(mat->get_name(),"alpha")); + } + if (_teststr(mat->get_name(),"vcol")) { + + mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); + mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); + mat->set_name(_fixstr(mat->get_name(),"vcol")); + } + + } + } + } + + if (p_node->cast_to<AnimationPlayer>()) { + //remove animations referencing non-importable nodes + AnimationPlayer *ap = p_node->cast_to<AnimationPlayer>(); + + List<StringName> anims; + ap->get_animation_list(&anims); + for(List<StringName>::Element *E=anims.front();E;E=E->next()) { + + Ref<Animation> anim=ap->get_animation(E->get()); + ERR_CONTINUE(anim.is_null()); + for(int i=0;i<anim->get_track_count();i++) { + NodePath path = anim->track_get_path(i); + + for(int j=0;j<path.get_name_count();j++) { + String node = path.get_name(j); + if (_teststr(node,"noimp")) { + anim->remove_track(i); + i--; + break; + } + } + } + + } + } + + + if (p_node->cast_to<MeshInstance>()) { + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + + String str; + + if ((_teststr(name,"imp"))) { + str=name; + } else if (mi->get_mesh().is_valid() && (_teststr(mi->get_mesh()->get_name(),"imp"))) { + str=mi->get_mesh()->get_name(); + + } + + + if (p_node->get_parent() && p_node->get_parent()->cast_to<MeshInstance>()) { + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + MeshInstance *mip = p_node->get_parent()->cast_to<MeshInstance>(); + String d=str.substr(str.find("imp")+3,str.length()); + if (d!="") { + if ((d[0]<'0' || d[0]>'9')) + d=d.substr(1,d.length()); + if (d.length() && d[0]>='0' && d[0]<='9') { + float dist = d.to_double(); + mi->set_flag(GeometryInstance::FLAG_BILLBOARD,true); + mi->set_flag(GeometryInstance::FLAG_BILLBOARD_FIX_Y,true); + //mi->set_draw_range_begin(dist); + //mi->set_draw_range_end(100000); + + //mip->set_draw_range_begin(0); + //mip->set_draw_range_end(dist); + + if (mi->get_mesh().is_valid()) { + + Ref<Mesh> m = mi->get_mesh(); + for(int i=0;i<m->get_surface_count();i++) { + + Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); + if (fm.is_valid()) { + //fm->set_flag(Material::FLAG_UNSHADED,true); + //fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); + //fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); + //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + } + } + } + } + } + } + } +#if 0 + if (p_flags&SCENE_FLAG_CREATE_LODS && p_node->cast_to<MeshInstance>()) { + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + + String str; + + if ((_teststr(name,"lod"))) { + str=name; + } else if (mi->get_mesh().is_valid() && (_teststr(mi->get_mesh()->get_name(),"lod"))) { + str=mi->get_mesh()->get_name(); + + } + + + if (p_node->get_parent() && p_node->get_parent()->cast_to<MeshInstance>()) { + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + MeshInstance *mip = p_node->get_parent()->cast_to<MeshInstance>(); + String d=str.substr(str.find("lod")+3,str.length()); + if (d!="") { + if ((d[0]<'0' || d[0]>'9')) + d=d.substr(1,d.length()); + if (d.length() && d[0]>='0' && d[0]<='9') { + float dist = d.to_double(); + /// mi->set_draw_range_begin(dist); + // mi->set_draw_range_end(100000); + + // mip->set_draw_range_begin(0); + // mip->set_draw_range_end(dist); + + /*if (mi->get_mesh().is_valid()) { + + Ref<Mesh> m = mi->get_mesh(); + for(int i=0;i<m->get_surface_count();i++) { + + Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); + if (fm.is_valid()) { + fm->set_flag(Material::FLAG_UNSHADED,true); + fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); + fm->set_hint(Material::HINT_NO_DEPTH_DRAW,true); + fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + } + } + }*/ + } + } + } + } + + + if (p_flags&SCENE_FLAG_DETECT_LIGHTMAP_LAYER && _teststr(name,"lm") && p_node->cast_to<MeshInstance>()) { + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + + String str=name; + int layer = str.substr(str.find("lm")+3,str.length()).to_int(); + //mi->set_baked_light_texture_id(layer); + } +#endif + if (_teststr(name,"colonly")) { + + if (isroot) + return p_node; + + if (p_node->cast_to<MeshInstance>()) { + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + Node * col = mi->create_trimesh_collision_node(); + ERR_FAIL_COND_V(!col,NULL); + + col->set_name(_fixstr(name,"colonly")); + col->cast_to<Spatial>()->set_transform(mi->get_transform()); + p_node->replace_by(col); + memdelete(p_node); + p_node=col; + + StaticBody *sb = col->cast_to<StaticBody>(); + CollisionShape *colshape = memnew( CollisionShape); + colshape->set_shape(sb->get_shape(0)); + colshape->set_name("shape"); + sb->add_child(colshape); + colshape->set_owner(p_node->get_owner()); + } else if (p_node->has_meta("empty_draw_type")) { + String empty_draw_type = String(p_node->get_meta("empty_draw_type")); + print_line(empty_draw_type); + StaticBody *sb = memnew( StaticBody); + sb->set_name(_fixstr(name,"colonly")); + sb->cast_to<Spatial>()->set_transform(p_node->cast_to<Spatial>()->get_transform()); + p_node->replace_by(sb); + memdelete(p_node); + CollisionShape *colshape = memnew( CollisionShape); + if (empty_draw_type == "CUBE") { + BoxShape *boxShape = memnew( BoxShape); + boxShape->set_extents(Vector3(1, 1, 1)); + colshape->set_shape(boxShape); + colshape->set_name("BoxShape"); + } else if (empty_draw_type == "SINGLE_ARROW") { + RayShape *rayShape = memnew( RayShape); + rayShape->set_length(1); + colshape->set_shape(rayShape); + colshape->set_name("RayShape"); + sb->cast_to<Spatial>()->rotate_x(Math_PI / 2); + } else if (empty_draw_type == "IMAGE") { + PlaneShape *planeShape = memnew( PlaneShape); + colshape->set_shape(planeShape); + colshape->set_name("PlaneShape"); + } else { + SphereShape *sphereShape = memnew( SphereShape); + sphereShape->set_radius(1); + colshape->set_shape(sphereShape); + colshape->set_name("SphereShape"); + } + sb->add_child(colshape); + colshape->set_owner(sb->get_owner()); + } + + } else if (_teststr(name,"rigid") && p_node->cast_to<MeshInstance>()) { + + if (isroot) + return p_node; + + // get mesh instance and bounding box + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + Rect3 aabb = mi->get_aabb(); + + // create a new rigid body collision node + RigidBody * rigid_body = memnew( RigidBody ); + Node * col = rigid_body; + ERR_FAIL_COND_V(!col,NULL); + + // remove node name postfix + col->set_name(_fixstr(name,"rigid")); + // get mesh instance xform matrix to the rigid body collision node + col->cast_to<Spatial>()->set_transform(mi->get_transform()); + // save original node by duplicating it into a new instance and correcting the name + Node * mesh = p_node->duplicate(); + mesh->set_name(_fixstr(name,"rigid")); + // reset the xform matrix of the duplicated node so it can inherit parent node xform + mesh->cast_to<Spatial>()->set_transform(Transform(Basis())); + // reparent the new mesh node to the rigid body collision node + p_node->add_child(mesh); + mesh->set_owner(p_node->get_owner()); + // replace the original node with the rigid body collision node + p_node->replace_by(col); + memdelete(p_node); + p_node=col; + + // create an alias for the rigid body collision node + RigidBody *rb = col->cast_to<RigidBody>(); + // create a new Box collision shape and set the right extents + Ref<BoxShape> shape = memnew( BoxShape ); + shape->set_extents(aabb.get_size() * 0.5); + CollisionShape *colshape = memnew( CollisionShape); + colshape->set_name("shape"); + colshape->set_shape(shape); + // reparent the new collision shape to the rigid body collision node + rb->add_child(colshape); + colshape->set_owner(p_node->get_owner()); + + } else if (_teststr(name,"col") && p_node->cast_to<MeshInstance>()) { + + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + + mi->set_name(_fixstr(name,"col")); + Node *col= mi->create_trimesh_collision_node(); + ERR_FAIL_COND_V(!col,NULL); + + col->set_name("col"); + p_node->add_child(col); + + StaticBody *sb=col->cast_to<StaticBody>(); + CollisionShape *colshape = memnew( CollisionShape); + colshape->set_shape(sb->get_shape(0)); + colshape->set_name("shape"); + col->add_child(colshape); + colshape->set_owner(p_node->get_owner()); + sb->set_owner(p_node->get_owner()); + + } else if (_teststr(name,"navmesh") && p_node->cast_to<MeshInstance>()) { + + if (isroot) + return p_node; + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + + Ref<Mesh> mesh=mi->get_mesh(); + ERR_FAIL_COND_V(mesh.is_null(),NULL); + NavigationMeshInstance *nmi = memnew( NavigationMeshInstance ); + + + nmi->set_name(_fixstr(name,"navmesh")); + Ref<NavigationMesh> nmesh = memnew( NavigationMesh); + nmesh->create_from_mesh(mesh); + nmi->set_navigation_mesh(nmesh); + nmi->cast_to<Spatial>()->set_transform(mi->get_transform()); + p_node->replace_by(nmi); + memdelete(p_node); + p_node=nmi; + } else if (_teststr(name,"vehicle")) { + + if (isroot) + return p_node; + + Node *owner = p_node->get_owner(); + Spatial *s = p_node->cast_to<Spatial>(); + VehicleBody *bv = memnew( VehicleBody ); + String n = _fixstr(p_node->get_name(),"vehicle"); + bv->set_name(n); + p_node->replace_by(bv); + p_node->set_name(n); + bv->add_child(p_node); + bv->set_owner(owner); + p_node->set_owner(owner); + bv->set_transform(s->get_transform()); + s->set_transform(Transform()); + + p_node=bv; + + + } else if (_teststr(name,"wheel")) { + + if (isroot) + return p_node; + + Node *owner = p_node->get_owner(); + Spatial *s = p_node->cast_to<Spatial>(); + VehicleWheel *bv = memnew( VehicleWheel ); + String n = _fixstr(p_node->get_name(),"wheel"); + bv->set_name(n); + p_node->replace_by(bv); + p_node->set_name(n); + bv->add_child(p_node); + bv->set_owner(owner); + p_node->set_owner(owner); + bv->set_transform(s->get_transform()); + s->set_transform(Transform()); + + p_node=bv; + + } else if (_teststr(name,"room") && p_node->cast_to<MeshInstance>()) { + + + if (isroot) + return p_node; + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + PoolVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID); + + + BSP_Tree bsptree(faces); + + Ref<RoomBounds> area = memnew( RoomBounds ); + //area->set_bounds(faces); + //area->set_geometry_hint(faces); + + + Room * room = memnew( Room ); + room->set_name(_fixstr(name,"room")); + room->set_transform(mi->get_transform()); + room->set_room(area); + + p_node->replace_by(room); + memdelete(p_node); + p_node=room; + + } else if (_teststr(name,"room")) { + + if (isroot) + return p_node; + + Spatial *dummy = p_node->cast_to<Spatial>(); + ERR_FAIL_COND_V(!dummy,NULL); + + Room * room = memnew( Room ); + room->set_name(_fixstr(name,"room")); + room->set_transform(dummy->get_transform()); + + p_node->replace_by(room); + memdelete(p_node); + p_node=room; + + //room->compute_room_from_subtree(); + + } else if (_teststr(name,"portal") && p_node->cast_to<MeshInstance>()) { + + if (isroot) + return p_node; + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + PoolVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID); + + ERR_FAIL_COND_V(faces.size()==0,NULL); + //step 1 compute the plane + Set<Vector3> points; + Plane plane; + + Vector3 center; + + for(int i=0;i<faces.size();i++) { + + Face3 f = faces.get(i); + Plane p = f.get_plane(); + plane.normal+=p.normal; + plane.d+=p.d; + + for(int i=0;i<3;i++) { + + Vector3 v = f.vertex[i].snapped(0.01); + if (!points.has(v)) { + points.insert(v); + center+=v; + } + } + } + + plane.normal.normalize(); + plane.d/=faces.size(); + center/=points.size(); + + //step 2, create points + + Transform t; + t.basis.from_z(plane.normal); + t.basis.transpose(); + t.origin=center; + + Vector<Point2> portal_points; + + for(Set<Vector3>::Element *E=points.front();E;E=E->next()) { + + Vector3 local = t.xform_inv(E->get()); + portal_points.push_back(Point2(local.x,local.y)); + } + // step 3 bubbly sort points + + int swaps=0; + + do { + swaps=0; + + for(int i=0;i<portal_points.size()-1;i++) { + + float a = portal_points[i].angle(); + float b = portal_points[i+1].angle(); + + if (a>b) { + SWAP( portal_points[i], portal_points[i+1] ); + swaps++; + } + + } + + } while(swaps); + + + Portal *portal = memnew( Portal ); + + portal->set_shape(portal_points); + portal->set_transform( mi->get_transform() * t); + + p_node->replace_by(portal); + memdelete(p_node); + p_node=portal; + + } else if (p_node->cast_to<MeshInstance>()) { + + //last attempt, maybe collision insde the mesh data + + MeshInstance *mi = p_node->cast_to<MeshInstance>(); + + Ref<Mesh> mesh = mi->get_mesh(); + if (!mesh.is_null()) { + + if (_teststr(mesh->get_name(),"col")) { + + mesh->set_name( _fixstr(mesh->get_name(),"col") ); + Ref<Shape> shape; + + if (collision_map.has(mesh)) { + shape = collision_map[mesh]; + + } else { + + shape = mesh->create_trimesh_shape(); + if (!shape.is_null()) + collision_map[mesh]=shape; + + + } + + if (!shape.is_null()) { +#if 0 + StaticBody* static_body = memnew( StaticBody ); + ERR_FAIL_COND_V(!static_body,NULL); + static_body->set_name( String(mesh->get_name()) + "_col" ); + shape->set_name(static_body->get_name()); + static_body->add_shape(shape); + + mi->add_child(static_body); + if (mi->get_owner()) + static_body->set_owner( mi->get_owner() ); +#endif + } + + } + + for(int i=0;i<mesh->get_surface_count();i++) { + + Ref<FixedSpatialMaterial> fm = mesh->surface_get_material(i); + if (fm.is_valid()) { + String name = fm->get_name(); + /* if (_teststr(name,"alpha")) { + fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + name=_fixstr(name,"alpha"); + } + + if (_teststr(name,"vcol")) { + fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true); + name=_fixstr(name,"vcol"); + }*/ + fm->set_name(name); + } + } + + } + + } + + + return p_node; +} + + +void ResourceImporterScene::_create_clips(Node *scene, const Array& p_clips,bool p_bake_all) { + + if (!scene->has_node(String("AnimationPlayer"))) + return; + + Node* n = scene->get_node(String("AnimationPlayer")); + ERR_FAIL_COND(!n); + AnimationPlayer *anim = n->cast_to<AnimationPlayer>(); + ERR_FAIL_COND(!anim); + + if (!anim->has_animation("default")) + return; + + + Ref<Animation> default_anim = anim->get_animation("default"); + + for(int i=0;i<p_clips.size();i+=4) { + + String name = p_clips[i]; + float from=p_clips[i+1]; + float to=p_clips[i+2]; + bool loop=p_clips[i+3]; + if (from>=to) + continue; + + Ref<Animation> new_anim = memnew( Animation ); + + for(int j=0;j<default_anim->get_track_count();j++) { + + + List<float> keys; + int kc = default_anim->track_get_key_count(j); + int dtrack=-1; + for(int k=0;k<kc;k++) { + + float kt = default_anim->track_get_key_time(j,k); + if (kt>=from && kt<to) { + + //found a key within range, so create track + if (dtrack==-1) { + new_anim->add_track(default_anim->track_get_type(j)); + dtrack = new_anim->get_track_count()-1; + new_anim->track_set_path(dtrack,default_anim->track_get_path(j)); + + if (kt>(from+0.01) && k>0) { + + if (default_anim->track_get_type(j)==Animation::TYPE_TRANSFORM) { + Quat q; + Vector3 p; + Vector3 s; + default_anim->transform_track_interpolate(j,from,&p,&q,&s); + new_anim->transform_track_insert_key(dtrack,0,p,q,s); + } + } + + } + + if (default_anim->track_get_type(j)==Animation::TYPE_TRANSFORM) { + Quat q; + Vector3 p; + Vector3 s; + default_anim->transform_track_get_key(j,k,&p,&q,&s); + new_anim->transform_track_insert_key(dtrack,kt-from,p,q,s); + } + + } + + if (dtrack!=-1 && kt>=to) { + + if (default_anim->track_get_type(j)==Animation::TYPE_TRANSFORM) { + Quat q; + Vector3 p; + Vector3 s; + default_anim->transform_track_interpolate(j,to,&p,&q,&s); + new_anim->transform_track_insert_key(dtrack,to-from,p,q,s); + } + } + + } + + if (dtrack==-1 && p_bake_all) { + new_anim->add_track(default_anim->track_get_type(j)); + dtrack = new_anim->get_track_count()-1; + new_anim->track_set_path(dtrack,default_anim->track_get_path(j)); + if (default_anim->track_get_type(j)==Animation::TYPE_TRANSFORM) { + + + Quat q; + Vector3 p; + Vector3 s; + default_anim->transform_track_interpolate(j,from,&p,&q,&s); + new_anim->transform_track_insert_key(dtrack,0,p,q,s); + default_anim->transform_track_interpolate(j,to,&p,&q,&s); + new_anim->transform_track_insert_key(dtrack,to-from,p,q,s); + } + + } + } + + + new_anim->set_loop(loop); + new_anim->set_length(to-from); + anim->add_animation(name,new_anim); + } + + anim->remove_animation("default"); //remove default (no longer needed) +} + +void ResourceImporterScene::_filter_anim_tracks(Ref<Animation> anim,Set<String> &keep) { + + Ref<Animation> a = anim; + ERR_FAIL_COND(!a.is_valid()); + + print_line("From Anim "+anim->get_name()+":"); + + for(int j=0;j<a->get_track_count();j++) { + + String path = a->track_get_path(j); + + if (!keep.has(path)) { + + print_line("Remove: "+path); + a->remove_track(j); + j--; + } + + } +} + + +void ResourceImporterScene::_filter_tracks(Node *scene, const String& p_text) { + + if (!scene->has_node(String("AnimationPlayer"))) + return; + Node* n = scene->get_node(String("AnimationPlayer")); + ERR_FAIL_COND(!n); + AnimationPlayer *anim = n->cast_to<AnimationPlayer>(); + ERR_FAIL_COND(!anim); + + Vector<String> strings = p_text.split("\n"); + for(int i=0;i<strings.size();i++) { + + strings[i]=strings[i].strip_edges(); + } + + List<StringName> anim_names; + anim->get_animation_list(&anim_names); + for(List<StringName>::Element *E=anim_names.front();E;E=E->next()) { + + String name = E->get(); + bool valid_for_this=false; + bool valid=false; + + Set<String> keep; + Set<String> keep_local; + + + for(int i=0;i<strings.size();i++) { + + + if (strings[i].begins_with("@")) { + + valid_for_this=false; + for(Set<String>::Element *F=keep_local.front();F;F=F->next()) { + keep.insert(F->get()); + } + keep_local.clear(); + + Vector<String> filters=strings[i].substr(1,strings[i].length()).split(","); + for(int j=0;j<filters.size();j++) { + + String fname = filters[j].strip_edges(); + if (fname=="") + continue; + int fc = fname[0]; + bool plus; + if (fc=='+') + plus=true; + else if (fc=='-') + plus=false; + else + continue; + + String filter=fname.substr(1,fname.length()).strip_edges(); + + if (!name.matchn(filter)) + continue; + valid_for_this=plus; + } + + if (valid_for_this) + valid=true; + + } else if (valid_for_this) { + + Ref<Animation> a = anim->get_animation(name); + if (!a.is_valid()) + continue; + + for(int j=0;j<a->get_track_count();j++) { + + String path = a->track_get_path(j); + + String tname = strings[i]; + if (tname=="") + continue; + int fc = tname[0]; + bool plus; + if (fc=='+') + plus=true; + else if (fc=='-') + plus=false; + else + continue; + + String filter=tname.substr(1,tname.length()).strip_edges(); + + if (!path.matchn(filter)) + continue; + + if (plus) + keep_local.insert(path); + else if (!keep.has(path)) { + keep_local.erase(path); + } + } + + } + + } + + if (valid) { + for(Set<String>::Element *F=keep_local.front();F;F=F->next()) { + keep.insert(F->get()); + } + _filter_anim_tracks(anim->get_animation(name),keep); + } else { + + } + + } + + + +} + +void ResourceImporterScene::_optimize_animations(Node *scene, float p_max_lin_error,float p_max_ang_error,float p_max_angle) { + + if (!scene->has_node(String("AnimationPlayer"))) + return; + Node* n = scene->get_node(String("AnimationPlayer")); + ERR_FAIL_COND(!n); + AnimationPlayer *anim = n->cast_to<AnimationPlayer>(); + ERR_FAIL_COND(!anim); + + + List<StringName> anim_names; + anim->get_animation_list(&anim_names); + for(List<StringName>::Element *E=anim_names.front();E;E=E->next()) { + + Ref<Animation> a = anim->get_animation(E->get()); + a->optimize(p_max_lin_error,p_max_ang_error,Math::deg2rad(p_max_angle)); + } +} + + +static String _make_extname(const String& p_str) { + + String ext_name=p_str.replace(".","_"); + ext_name=ext_name.replace(":","_"); + ext_name=ext_name.replace("\"","_"); + ext_name=ext_name.replace("<","_"); + ext_name=ext_name.replace(">","_"); + ext_name=ext_name.replace("/","_"); + ext_name=ext_name.replace("|","_"); + ext_name=ext_name.replace("\\","_"); + ext_name=ext_name.replace("?","_"); + ext_name=ext_name.replace("*","_"); + + return ext_name; +} + +void ResourceImporterScene::_make_external_resources(Node* p_node,const String& p_base_path, bool p_make_materials, bool p_make_meshes, Map<Ref<Material>,Ref<Material> >& p_materials, Map<Ref<Mesh>,Ref<Mesh> >& p_meshes) { + + List<PropertyInfo> pi; + + p_node->get_property_list(&pi); + + for (List<PropertyInfo>::Element *E=pi.front();E;E=E->next()) { + + if (E->get().type==Variant::OBJECT) { + + Ref<Material> mat = p_node->get(E->get().name); + if (p_make_materials && mat.is_valid() && mat->get_name()!="") { + + + if (!p_materials.has(mat)) { + + String ext_name = p_base_path+"."+_make_extname(mat->get_name())+".mtl"; + if (FileAccess::exists(ext_name)) { + //if exists, use it + Ref<Material> existing = ResourceLoader::load(ext_name); + p_materials[mat]=existing; + } else { + + ResourceSaver::save(ext_name,mat,ResourceSaver::FLAG_CHANGE_PATH); + p_materials[mat]=mat; + } + } + + if (p_materials[mat]!=mat) { + + p_node->set(E->get().name,p_materials[mat]); + } + } else { + + Ref<Mesh> mesh = p_node->get(E->get().name); + + if (mesh.is_valid()) { + + bool mesh_just_added=false; + + if (p_make_meshes) { + + if (!p_meshes.has(mesh)) { + + String ext_name = p_base_path+"."+_make_extname(mesh->get_name())+".msh"; + if (FileAccess::exists(ext_name)) { + //if exists, use it + Ref<Mesh> existing = ResourceLoader::load(ext_name); + p_meshes[mesh]=existing; + } else { + + ResourceSaver::save(ext_name,mesh,ResourceSaver::FLAG_CHANGE_PATH); + p_meshes[mesh]=mesh; + mesh_just_added=true; + } + + + } + } + + + if (p_make_materials){ + + if (mesh_just_added || !p_meshes.has(mesh)) { + + + for(int i=0;i<mesh->get_surface_count();i++) { + mat=mesh->surface_get_material(i); + if (!mat.is_valid() || mat->get_name()=="") + continue; + + if (!p_materials.has(mat)) { + + String ext_name = p_base_path+"."+_make_extname(mat->get_name())+".mtl"; + if (FileAccess::exists(ext_name)) { + //if exists, use it + Ref<Material> existing = ResourceLoader::load(ext_name); + p_materials[mat]=existing; + } else { + + ResourceSaver::save(ext_name,mat,ResourceSaver::FLAG_CHANGE_PATH); + p_materials[mat]=mat; + } + } + + if (p_materials[mat]!=mat) { + + mesh->surface_set_material(i,p_materials[mat]); + } + + } + + if(!p_make_meshes) { + p_meshes[mesh]=Ref<Mesh>(); //save it anyway, so it won't be checked again + } + } + } + } + } + } + } + + for(int i=0;i<p_node->get_child_count();i++) { + + _make_external_resources(p_node->get_child(i),p_base_path,p_make_materials,p_make_meshes,p_materials,p_meshes); + } +} + + +void ResourceImporterScene::get_import_options(List<ImportOption> *r_options,int p_preset) const { + + + r_options->push_back(ImportOption(PropertyInfo(Variant::STRING,"nodes/root_type",PROPERTY_HINT_TYPE_STRING,"Node"),"Spatial")); + r_options->push_back(ImportOption(PropertyInfo(Variant::STRING,"nodes/root_name"),"Scene Root")); + + List<String> script_extentions; + ResourceLoader::get_recognized_extensions_for_type("Script",&script_extentions); + + String script_ext_hint; + + for(List<String>::Element *E=script_extentions.front();E;E=E->next()) { + if (script_ext_hint!="") + script_ext_hint+=","; + script_ext_hint+="*."+E->get(); + } + + r_options->push_back(ImportOption(PropertyInfo(Variant::STRING,"nodes/custom_script",PROPERTY_HINT_FILE,script_ext_hint),"")); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"materials/location",PROPERTY_HINT_ENUM,"Node,Mesh"),0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"materials/storage",PROPERTY_HINT_ENUM,"Bult-In,Files"),0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"geometry/compress"),true)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"geometry/ensure_tangents"),true)); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"geometry/storage",PROPERTY_HINT_ENUM,"Built-In,Files"),0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"animation/import",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED),true)); + r_options->push_back(ImportOption(PropertyInfo(Variant::REAL,"animation/fps",PROPERTY_HINT_RANGE,"1,120,1"),15)); + r_options->push_back(ImportOption(PropertyInfo(Variant::STRING,"animation/filter_script",PROPERTY_HINT_MULTILINE_TEXT),"")); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"animation/optimizer/enabled",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED),true)); + r_options->push_back(ImportOption(PropertyInfo(Variant::REAL,"animation/optimizer/max_linear_error"),0.05)); + r_options->push_back(ImportOption(PropertyInfo(Variant::REAL,"animation/optimizer/max_angular_error"),0.01)); + r_options->push_back(ImportOption(PropertyInfo(Variant::REAL,"animation/optimizer/max_angle"),22)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"animation/optimizer/remove_unused_tracks"),true)); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"animation/clips/amount",PROPERTY_HINT_RANGE,"0,256,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED),0)); + for(int i=0;i<256;i++) { + r_options->push_back(ImportOption(PropertyInfo(Variant::STRING,"animation/clip_"+itos(i+1)+"/name"),"")); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"animation/clip_"+itos(i+1)+"/start_frame"),0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"animation/clip_"+itos(i+1)+"/end_frame"),0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"animation/clip_"+itos(i+1)+"/loops"),false)); + } +} + +Error ResourceImporterScene::import(const String& p_source_file, const String& p_save_path, const Map<StringName,Variant>& p_options, List<String>* r_platform_variants, List<String> *r_gen_files) { + + String src_path=p_source_file; + + Ref<EditorSceneImporter> importer; + String ext=src_path.get_extension().to_lower(); + + + EditorProgress progress("import",TTR("Import Scene"),104); + progress.step(TTR("Importing Scene.."),0); + + for(Set< Ref<EditorSceneImporter> >::Element *E=importers.front();E;E=E->next()) { + + List<String> extensions; + E->get()->get_extensions(&extensions); + + for(List<String>::Element *F=extensions.front();F;F=F->next()) { + + if (F->get().to_lower()==ext) { + + importer = E->get(); + break; + } + } + + if (importer.is_valid()) + break; + } + + ERR_FAIL_COND_V(!importer.is_valid(),ERR_FILE_UNRECOGNIZED); + + float fps=p_options["animation/fps"]; + + + + int import_flags=EditorSceneImporter::IMPORT_ANIMATION_DETECT_LOOP; + if (!bool(p_options["animation/optimizer/remove_unused_tracks"])) + import_flags|=EditorSceneImporter::IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS; + + if (bool(p_options["animation/import"])) + import_flags|=EditorSceneImporter::IMPORT_ANIMATION; + + if (bool(p_options["geometry/ensure_tangents"])) + import_flags|=EditorSceneImporter::IMPORT_GENERATE_TANGENT_ARRAYS; + + if (int(p_options["materials/location"])==0) + import_flags|=EditorSceneImporter::IMPORT_MATERIALS_IN_INSTANCES; + + + Error err=OK; + List<String> missing_deps; // for now, not much will be done with this + Node *scene = importer->import_scene(src_path,import_flags,fps,&missing_deps,&err); + if (!scene || err!=OK) { + return err; + } + + String root_type = p_options["nodes/root_type"]; + + if (scene->get_class()!=root_type) { + Object *base = ClassDB::instance(root_type); + Node *base_node = NULL; + if (base) + base_node=base->cast_to<Node>(); + + if (base_node) { + + scene->replace_by(base_node); + memdelete(scene); + scene=base_node; + } + } + + scene->set_name(p_options["nodes/root_name"]); + + + err=OK; + + String animation_filter = String(p_options["animation/filter_script"]).strip_edges(); + + bool use_optimizer = p_options["animation/optimizer/enabled"]; + float anim_optimizer_linerr=p_options["animation/optimizer/max_linear_error"]; + float anim_optimizer_angerr=p_options["animation/optimizer/max_angular_error"]; + float anim_optimizer_maxang=p_options["animation/optimizer/max_angle"]; + + Map<Ref<Mesh>,Ref<Shape> > collision_map; + + scene=_fix_node(scene,scene,collision_map); + + if (use_optimizer) { + _optimize_animations(scene,anim_optimizer_linerr,anim_optimizer_angerr,anim_optimizer_maxang); + } + + Array animation_clips; + { + + + int clip_count = p_options["animation/clips/amount"]; + + for(int i=0;i<clip_count;i++) { + String name = p_options["animation/clip_"+itos(i+1)+"/name"]; + int from_frame = p_options["animation/clip_"+itos(i+1)+"/start_frame"]; + int end_frame = p_options["animation/clip_"+itos(i+1)+"/end_frame"]; + bool loop = p_options["animation/clip_"+itos(i+1)+"/loops"]; + + animation_clips.push_back(name); + animation_clips.push_back(from_frame/fps); + animation_clips.push_back(end_frame/fps); + animation_clips.push_back(loop); + } + + } + if (animation_clips.size()) { + _create_clips(scene,animation_clips,!bool(p_options["animation/optimizer/remove_unused_tracks"])); + } + + if (animation_filter!="") { + _filter_tracks(scene,animation_filter); + } + + + bool external_materials = p_options["materials/storage"]; + bool external_meshes = p_options["geometry/storage"]; + + if (external_materials || external_meshes) { + Map<Ref<Material>, Ref<Material> > mat_map; + Map<Ref<Mesh>, Ref<Mesh> > mesh_map; + _make_external_resources(scene,p_source_file.get_basename(),external_materials,external_meshes,mat_map,mesh_map); + } + + progress.step(TTR("Running Custom Script.."),2); + + String post_import_script_path = p_options["nodes/custom_script"]; + Ref<EditorScenePostImport> post_import_script; + + if (post_import_script_path!="") { + post_import_script_path = post_import_script_path; + Ref<Script> scr = ResourceLoader::load(post_import_script_path); + if (!scr.is_valid()) { + EditorNode::add_io_error(TTR("Couldn't load post-import script:")+" "+post_import_script_path); + } else { + + post_import_script = Ref<EditorScenePostImport>( memnew( EditorScenePostImport ) ); + post_import_script->set_script(scr.get_ref_ptr()); + if (!post_import_script->get_script_instance()) { + EditorNode::add_io_error(TTR("Invalid/broken script for post-import (check console):")+" "+post_import_script_path); + post_import_script.unref(); + return ERR_CANT_CREATE; + } + } + } + + + if (post_import_script.is_valid()) { + scene = post_import_script->post_import(scene); + if (!scene) { + EditorNode::add_io_error(TTR("Error running post-import script:")+" "+post_import_script_path); + return err; + } + + + } + + progress.step(TTR("Saving.."),104); + + Ref<PackedScene> packer = memnew( PackedScene ); + packer->pack(scene); + print_line("SAVING TO: "+p_save_path+".scn"); + err = ResourceSaver::save(p_save_path+".scn",packer); //do not take over, let the changed files reload themselves + + memdelete(scene); + + EditorNode::get_singleton()->reload_scene(p_source_file); + + return OK; +} + +ResourceImporterScene *ResourceImporterScene::singleton=NULL; + +ResourceImporterScene::ResourceImporterScene() +{ + singleton=this; +} diff --git a/tools/editor/import/resource_importer_scene.h b/tools/editor/import/resource_importer_scene.h new file mode 100644 index 0000000000..cfa44b160a --- /dev/null +++ b/tools/editor/import/resource_importer_scene.h @@ -0,0 +1,93 @@ +#ifndef RESOURCEIMPORTERSCENE_H +#define RESOURCEIMPORTERSCENE_H + +#include "io/resource_import.h" +#include "scene/resources/animation.h" +#include "scene/resources/shape.h" + +class Material; + +class EditorSceneImporter : public Reference { + + GDCLASS(EditorSceneImporter,Reference ); +public: + + enum ImportFlags { + IMPORT_SCENE=1, + IMPORT_ANIMATION=2, + IMPORT_ANIMATION_DETECT_LOOP=4, + IMPORT_ANIMATION_OPTIMIZE=8, + IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS=16, + IMPORT_ANIMATION_KEEP_VALUE_TRACKS=32, + IMPORT_GENERATE_TANGENT_ARRAYS=256, + IMPORT_FAIL_ON_MISSING_DEPENDENCIES=512, + IMPORT_MATERIALS_IN_INSTANCES=1024 + + }; + + virtual uint32_t get_import_flags() const=0; + virtual void get_extensions(List<String> *r_extensions) const=0; + virtual Node* import_scene(const String& p_path,uint32_t p_flags,int p_bake_fps,List<String> *r_missing_deps,Error* r_err=NULL)=0; + virtual Ref<Animation> import_animation(const String& p_path,uint32_t p_flags)=0; + + + + EditorSceneImporter() {} +}; + +class EditorScenePostImport : public Reference { + + GDCLASS(EditorScenePostImport,Reference ); +protected: + + static void _bind_methods(); +public: + + virtual Node* post_import(Node* p_scene); + EditorScenePostImport(); +}; + + +class ResourceImporterScene : public ResourceImporter { + GDCLASS(ResourceImporterScene,ResourceImporter) + + Set< Ref<EditorSceneImporter> > importers; + + static ResourceImporterScene *singleton; +public: + + static ResourceImporterScene *get_singleton() { return singleton; } + + const Set< Ref<EditorSceneImporter> >& get_importers() const { return importers; } + + void add_importer(Ref<EditorSceneImporter> p_importer) { importers.insert(p_importer); } + + virtual String get_importer_name() const; + virtual String get_visible_name() const; + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual String get_save_extension() const; + virtual String get_resource_type() const; + + + virtual int get_preset_count() const; + virtual String get_preset_name(int p_idx) const; + + virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; + virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; + + void _make_external_resources(Node* p_node,const String& p_base_path, bool p_make_materials, bool p_make_meshes, Map<Ref<Material>, Ref<Material> > &p_materials, Map<Ref<Mesh>, Ref<Mesh> > &p_meshes); + + Node* _fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>,Ref<Shape> > &collision_map); + + void _create_clips(Node *scene, const Array& p_clips,bool p_bake_all); + void _filter_anim_tracks(Ref<Animation> anim,Set<String> &keep); + void _filter_tracks(Node *scene, const String& p_text); + void _optimize_animations(Node *scene, float p_max_lin_error,float p_max_ang_error,float p_max_angle); + + virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); + + ResourceImporterScene(); +}; + + +#endif // RESOURCEIMPORTERSCENE_H diff --git a/tools/editor/import/resource_importer_texture.cpp b/tools/editor/import/resource_importer_texture.cpp index 3cbe034e4d..21e434fa11 100644 --- a/tools/editor/import/resource_importer_texture.cpp +++ b/tools/editor/import/resource_importer_texture.cpp @@ -1,6 +1,106 @@ #include "resource_importer_texture.h" #include "io/image_loader.h" #include "scene/resources/texture.h" +#include "tools/editor/editor_file_system.h" +#include "io/config_file.h" + + +void ResourceImporterTexture::_texture_reimport_srgb(const Ref<StreamTexture>& p_tex) { + + singleton->mutex->lock(); + StringName path = p_tex->get_path(); + + if (!singleton->make_flags.has(path)) { + singleton->make_flags[path]=0; + } + + singleton->make_flags[path]|=MAKE_SRGB_FLAG; + + print_line("requesting srgb for "+String(path)); + + singleton->mutex->unlock(); + +} + + + +void ResourceImporterTexture::_texture_reimport_3d(const Ref<StreamTexture>& p_tex) { + + + singleton->mutex->lock(); + StringName path = p_tex->get_path(); + + if (!singleton->make_flags.has(path)) { + singleton->make_flags[path]=0; + } + + singleton->make_flags[path]|=MAKE_3D_FLAG; + + print_line("requesting 3d for "+String(path)); + + singleton->mutex->unlock(); + + +} + +void ResourceImporterTexture::update_imports() { + + if (EditorFileSystem::get_singleton()->is_scanning() || EditorFileSystem::get_singleton()->is_importing()) { + return; // do nothing for noe + } + mutex->lock(); + + if (make_flags.empty()) { + mutex->unlock(); + return; + } + + Vector<String> to_reimport; + for (Map<StringName,int>::Element *E=make_flags.front();E;E=E->next()) { + + print_line("checking for reimport "+String(E->key())); + + + Ref<ConfigFile> cf; + cf.instance(); + String src_path = String(E->key())+".import"; + + Error err = cf->load(src_path); + ERR_CONTINUE(err!=OK); + + bool changed=false; + if (E->get()&MAKE_SRGB_FLAG && int(cf->get_value("params","flags/srgb"))==2) { + cf->set_value("params","flags/srgb",1); + changed=true; + } + + if (E->get()&MAKE_3D_FLAG && bool(cf->get_value("params","detect_3d"))) { + cf->set_value("params","detect_3d",false); + cf->set_value("params","compress/mode",2); + cf->set_value("params","flags/repeat",true); + cf->set_value("params","flags/filter",true); + cf->set_value("params","flags/mipmaps",true); + changed=true; + } + + if (changed) { + cf->save(src_path); + to_reimport.push_back(E->key()); + } + + } + + make_flags.clear(); + + mutex->unlock(); + + if (to_reimport.size()) { + EditorFileSystem::get_singleton()->reimport_files(to_reimport); + } + +} + + String ResourceImporterTexture::get_importer_name() const { @@ -57,7 +157,7 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options,i r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"flags/filter"),p_preset==PRESET_2D_PIXEL?false:true)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"flags/mipmaps"),p_preset==PRESET_3D?true:false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"flags/anisotropic"),false)); - r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"flags/srgb",PROPERTY_HINT_ENUM,"Disable,Enable,Detect"),2)); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"flags/srgb",PROPERTY_HINT_ENUM,"Disable,Enable,Detect"),2)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"process/fix_alpha_border"),p_preset!=PRESET_3D?true:false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL,"process/premult_alpha"),true)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT,"stream"),false)); @@ -67,7 +167,7 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options,i } -void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to_path,int p_compress_mode,float p_lossy_quality,Image::CompressMode p_vram_compression,bool p_mipmaps,int p_texture_flags,bool p_streamable) { +void ResourceImporterTexture::_save_stex(const Image& p_image, const String& p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable, bool p_detect_3d, bool p_detect_srgb) { FileAccess *f = FileAccess::open(p_to_path,FileAccess::WRITE); @@ -86,6 +186,11 @@ void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to format|=StreamTexture::FORMAT_BIT_STREAM; if (p_mipmaps || p_compress_mode==COMPRESS_VIDEO_RAM) //VRAM always uses mipmaps format|=StreamTexture::FORMAT_BIT_HAS_MIPMAPS; //mipmaps bit + if (p_detect_3d) + format|=StreamTexture::FORMAT_BIT_DETECT_3D; + if (p_detect_srgb) + format|=StreamTexture::FORMAT_BIT_DETECT_SRGB; + switch (p_compress_mode) { case COMPRESS_LOSSLESS: { @@ -99,7 +204,7 @@ void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to int mmc = image.get_mipmap_count() + 1; - format=StreamTexture::FORMAT_BIT_LOSSLESS; + format|=StreamTexture::FORMAT_BIT_LOSSLESS; f->store_32(format); f->store_32(mmc); @@ -130,7 +235,7 @@ void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to int mmc = image.get_mipmap_count() + 1; - format=StreamTexture::FORMAT_BIT_LOSSY; + format|=StreamTexture::FORMAT_BIT_LOSSY; f->store_32(format); f->store_32(mmc); @@ -162,7 +267,6 @@ void ResourceImporterTexture::_save_stex(const Image& p_image,const String& p_to PoolVector<uint8_t> data=image.get_data(); int dl = data.size(); PoolVector<uint8_t>::Read r = data.read(); - f->store_buffer(r.ptr(),dl); } break; @@ -198,7 +302,7 @@ Error ResourceImporterTexture::import(const String& p_source_file, const String& bool filter= p_options["flags/filter"]; bool mipmaps= p_options["flags/mipmaps"]; bool anisotropic= p_options["flags/anisotropic"]; - bool srgb= p_options["flags/srgb"]; + int srgb= p_options["flags/srgb"]; bool fix_alpha_border= p_options["process/fix_alpha_border"]; bool premult_alpha= p_options["process/premult_alpha"]; bool stream = p_options["stream"]; @@ -222,7 +326,7 @@ Error ResourceImporterTexture::import(const String& p_source_file, const String& tex_flags|=Texture::FLAG_MIPMAPS; if (anisotropic) tex_flags|=Texture::FLAG_ANISOTROPIC_FILTER; - if (srgb) + if (srgb==1) tex_flags|=Texture::FLAG_CONVERT_TO_LINEAR; if (size_limit >0 && (image.get_width()>size_limit || image.get_height()>size_limit )) { @@ -249,26 +353,41 @@ Error ResourceImporterTexture::import(const String& p_source_file, const String& image.premultiply_alpha(); } + bool detect_3d = p_options["detect_3d"]; + bool detect_srgb = srgb==2; if (compress_mode==COMPRESS_VIDEO_RAM) { //must import in all formats //Android, GLES 2.x - _save_stex(image,p_save_path+".etc.stex",compress_mode,lossy,Image::COMPRESS_ETC,mipmaps,tex_flags,stream); + _save_stex(image,p_save_path+".etc.stex",compress_mode,lossy,Image::COMPRESS_ETC,mipmaps,tex_flags,stream,detect_3d,detect_srgb); r_platform_variants->push_back("etc"); //_save_stex(image,p_save_path+".etc2.stex",compress_mode,lossy,Image::COMPRESS_ETC2,mipmaps,tex_flags,stream); //r_platform_variants->push_back("etc2"); - _save_stex(image,p_save_path+".s3tc.stex",compress_mode,lossy,Image::COMPRESS_S3TC,mipmaps,tex_flags,stream); + _save_stex(image,p_save_path+".s3tc.stex",compress_mode,lossy,Image::COMPRESS_S3TC,mipmaps,tex_flags,stream,detect_3d,detect_srgb); r_platform_variants->push_back("s3tc"); } else { //import normally - _save_stex(image,p_save_path+".stex",compress_mode,lossy,Image::COMPRESS_16BIT /*this is ignored */,mipmaps,tex_flags,stream); + _save_stex(image,p_save_path+".stex",compress_mode,lossy,Image::COMPRESS_16BIT /*this is ignored */,mipmaps,tex_flags,stream,detect_3d,detect_srgb); } return OK; } +ResourceImporterTexture *ResourceImporterTexture::singleton=NULL; + ResourceImporterTexture::ResourceImporterTexture() { + singleton=this; + StreamTexture::request_3d_callback=_texture_reimport_3d; + StreamTexture::request_srgb_callback=_texture_reimport_srgb; + mutex = Mutex::create(); } + +ResourceImporterTexture::~ResourceImporterTexture() +{ + + memdelete(mutex); +} + diff --git a/tools/editor/import/resource_importer_texture.h b/tools/editor/import/resource_importer_texture.h index 84f7b77838..4c795e132c 100644 --- a/tools/editor/import/resource_importer_texture.h +++ b/tools/editor/import/resource_importer_texture.h @@ -2,10 +2,33 @@ #define RESOURCEIMPORTTEXTURE_H #include "io/resource_import.h" +class StreamTexture; class ResourceImporterTexture : public ResourceImporter { GDCLASS(ResourceImporterTexture,ResourceImporter) + + + +protected: + + enum { + MAKE_3D_FLAG=1, + MAKE_SRGB_FLAG=2 + }; + + Mutex *mutex; + Map<StringName,int> make_flags; + + static void _texture_reimport_srgb(const Ref<StreamTexture>& p_tex); + static void _texture_reimport_3d(const Ref<StreamTexture>& p_tex); + + + + + static ResourceImporterTexture *singleton; public: + + static ResourceImporterTexture *get_singleton() { return singleton; } virtual String get_importer_name() const; virtual String get_visible_name() const; virtual void get_recognized_extensions(List<String> *p_extensions) const; @@ -33,11 +56,15 @@ public: virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; - void _save_stex(const Image& p_image, const String& p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable); + void _save_stex(const Image& p_image, const String& p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable,bool p_detect_3d,bool p_detect_srgb); virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); + + void update_imports(); + ResourceImporterTexture(); + ~ResourceImporterTexture(); }; #endif // RESOURCEIMPORTTEXTURE_H diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp index 9438af9072..5ecb0b1abf 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -346,7 +346,7 @@ public: add_to_project = memnew( CheckButton); add_to_project->set_pressed(true); - add_to_project->set_text(TTR("Add to Project (engine.cfg)")); + add_to_project->set_text(TTR("Add to Project (godot.cfg)")); tcomp->add_child(add_to_project); file_select = memnew(EditorFileDialog); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 4738b348f4..5f97fce4e7 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1334,6 +1334,7 @@ void ScriptEditor::_find_scripts(Node* p_base, Node* p_current, Set<Ref<Script> struct _ScriptEditorItemData { String name; + String sort_key; Ref<Texture> icon; int index; String tooltip; @@ -1343,7 +1344,7 @@ struct _ScriptEditorItemData { bool operator<(const _ScriptEditorItemData& id) const { - return category==id.category?name.nocasecmp_to(id.name)<0:category<id.category; + return category==id.category?sort_key<id.sort_key:category<id.category; } }; @@ -1404,6 +1405,8 @@ void ScriptEditor::_update_script_names() { script_list->clear(); bool split_script_help = EditorSettings::get_singleton()->get("text_editor/open_scripts/group_help_pages"); + ScriptSortBy sort_by = (ScriptSortBy) (int) EditorSettings::get_singleton()->get("text_editor/open_scripts/sort_scripts_by"); + ScriptListName display_as = (ScriptListName) (int) EditorSettings::get_singleton()->get("text_editor/open_scripts/list_script_names_as"); Vector<_ScriptEditorItemData> sedata; @@ -1415,15 +1418,41 @@ void ScriptEditor::_update_script_names() { String name = se->get_name(); Ref<Texture> icon = se->get_icon(); - String tooltip = se->get_edited_script()->get_path(); + String path = se->get_edited_script()->get_path(); _ScriptEditorItemData sd; sd.icon=icon; sd.name=name; - sd.tooltip=tooltip; + sd.tooltip=path; sd.index=i; sd.used=used.has(se->get_edited_script()); sd.category=0; + + switch (sort_by) { + case SORT_BY_NAME: { + sd.sort_key=name.to_lower(); + } break; + case SORT_BY_PATH: { + sd.sort_key=path; + } break; + } + + switch (display_as) { + case DISPLAY_NAME: { + sd.name=name; + } break; + case DISPLAY_DIR_AND_NAME: { + if (!path.get_base_dir().get_file().empty()) { + sd.name=path.get_base_dir().get_file() + "/" + name; + } else { + sd.name=name; + } + } break; + case DISPLAY_FULL_PATH: { + sd.name=path; + } break; + } + sedata.push_back(sd); } @@ -1438,6 +1467,7 @@ void ScriptEditor::_update_script_names() { _ScriptEditorItemData sd; sd.icon=icon; sd.name=name; + sd.sort_key=name; sd.tooltip=tooltip; sd.index=i; sd.used=false; @@ -1727,6 +1757,7 @@ void ScriptEditor::_editor_settings_changed() { se->update_settings(); } _update_script_colors(); + _update_script_names(); ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/files/auto_reload_and_parse_scripts_on_save",true)); @@ -2440,9 +2471,13 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EDITOR_DEF("text_editor/open_scripts/script_temperature_cold_color",Color(0,0,1,0.3)); EDITOR_DEF("text_editor/open_scripts/current_script_background_color",Color(0.81,0.81,0.14,0.63)); EDITOR_DEF("text_editor/open_scripts/group_help_pages",true); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT,"text_editor/open_scripts/sort_scripts_by",PROPERTY_HINT_ENUM,"Name,Path")); + EDITOR_DEF("text_editor/open_scripts/sort_scripts_by",0); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT,"text_editor/open_scripts/list_script_names_as",PROPERTY_HINT_ENUM,"Name,Parent Directory And Name,Full Path")); + EDITOR_DEF("text_editor/open_scripts/list_script_names_as",0); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"text_editor/external/exec_path",PROPERTY_HINT_GLOBAL_FILE)); EDITOR_DEF("text_editor/external/exec_flags",""); - + } diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h index 887c2f7d68..75099fc5ec 100644 --- a/tools/editor/plugins/script_editor_plugin.h +++ b/tools/editor/plugins/script_editor_plugin.h @@ -154,6 +154,17 @@ class ScriptEditor : public VBoxContainer { WINDOW_PREV, WINDOW_SELECT_BASE=100 }; + + enum ScriptSortBy { + SORT_BY_NAME, + SORT_BY_PATH, + }; + + enum ScriptListName { + DISPLAY_NAME, + DISPLAY_DIR_AND_NAME, + DISPLAY_FULL_PATH, + }; HBoxContainer *menu_hb; MenuButton *file_menu; diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 9f8367ff1d..3ba1a2cbdc 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -277,12 +277,10 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() ); Set<Ref<SpatialEditorGizmo> > found_gizmos; - //uint32_t closest=0; - //float closest_dist=0; - - r_includes_current=false; - - List<_RayResult> results; + ObjectID closest=0; + Spatial *item=NULL; + float closest_dist=1e20; + int selected_handle=-1; for (int i=0;i<instances.size();i++) { @@ -318,84 +316,30 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b if (dist<0) continue; + if (dist < closest_dist) { + closest=instances[i]; + closest_dist=dist; + selected_handle=handle; + item=spat; + } + // if (editor_selection->is_selected(spat)) + // r_includes_current=true; - if (editor_selection->is_selected(spat)) - r_includes_current=true; - - _RayResult res; - res.item=spat; - res.depth=dist; - res.handle=handle; - results.push_back(res); } - if (results.empty()) + if (!item) return 0; - results.sort(); - Spatial *s=NULL; - + if (!editor_selection->is_selected(item) || (r_gizmo_handle && selected_handle>=0)) { - if (!r_includes_current || results.size()==1 || (r_gizmo_handle && results.front()->get().handle>=0)) { - - //return the nearest one - s = results.front()->get().item; if (r_gizmo_handle) - *r_gizmo_handle=results.front()->get().handle; - - } else { - - //returns the next one from a curent selection - List<_RayResult>::Element *E=results.front(); - List<_RayResult>::Element *S=NULL; - + *r_gizmo_handle=selected_handle; - while(true) { - - //very strange loop algorithm that complies with object selection standards (tm). - - if (S==E) { - //went all around and anothing was found - //since can't rotate the selection - //just return the first one - - s=results.front()->get().item; - break; - - } - - if (!S && editor_selection->is_selected(E->get().item)) { - //found an item currently in the selection, - //so start from this one - S=E; - } - - if (S && !editor_selection->is_selected(E->get().item)) { - // free item after a selected item, this one is desired. - s=E->get().item; - break; - } - - E=E->next(); - if (!E) { - - if (!S) { - //did a loop but nothing was selected, select first - s=results.front()->get().item; - break; - - } - E=results.front(); - } - } } - if (!s) - return 0; - - return s->get_instance_ID(); + return closest; } @@ -3143,7 +3087,7 @@ void SpatialEditor::_init_indicators() { indicator_mat.instance(); indicator_mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); - indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true); + //indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true); indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); indicator_mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 4472cff9cc..2fa62df5bc 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -450,8 +450,8 @@ void ProjectExportDialog::_export_action(const String& p_file) { while(true) { - print_line("TESTING: "+location.plus_file("engine.cfg")); - if (FileAccess::exists(location.plus_file("engine.cfg"))) { + print_line("TESTING: "+location.plus_file("godot.cfg")); + if (FileAccess::exists(location.plus_file("godot.cfg"))) { error->set_text(TTR("Please export outside the project folder!")); error->popup_centered_minsize(); @@ -2099,7 +2099,7 @@ Error ProjectExport::export_project(const String& p_preset) { added_settings["remap/"+platform]=Variant(remaps).operator Array(); } - String engine_cfg_path=d->get_current_dir()+"/engine.cfg"; + String engine_cfg_path=d->get_current_dir()+"/godot.cfg"; print_line("enginecfg: "+engine_cfg_path); GlobalConfig::get_singleton()->save_custom(engine_cfg_path,added_settings); diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index fb8cccdb79..af73414ab0 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -92,18 +92,18 @@ private: if (mode!=MODE_IMPORT) { - if (d->file_exists("engine.cfg")) { + if (d->file_exists("godot.cfg")) { - error->set_text(TTR("Invalid project path, engine.cfg must not exist.")); + error->set_text(TTR("Invalid project path, godot.cfg must not exist.")); memdelete(d); return ""; } } else { - if (valid_path != "" && !d->file_exists("engine.cfg")) { + if (valid_path != "" && !d->file_exists("godot.cfg")) { - error->set_text(TTR("Invalid project path, engine.cfg must exist.")); + error->set_text(TTR("Invalid project path, godot.cfg must exist.")); memdelete(d); return ""; } @@ -137,7 +137,7 @@ private: String p = p_path; if (mode==MODE_IMPORT) { - if (p.ends_with("engine.cfg")) { + if (p.ends_with("godot.cfg")) { p=p.get_base_dir(); } @@ -163,7 +163,7 @@ private: fdialog->set_mode(FileDialog::MODE_OPEN_FILE); fdialog->clear_filters(); - fdialog->add_filter("engine.cfg ; " _MKSTR(VERSION_NAME) " Project"); + fdialog->add_filter("godot.cfg ; " _MKSTR(VERSION_NAME) " Project"); } else { fdialog->set_mode(FileDialog::MODE_OPEN_DIR); } @@ -190,9 +190,9 @@ private: - FileAccess *f = FileAccess::open(dir.plus_file("/engine.cfg"),FileAccess::WRITE); + FileAccess *f = FileAccess::open(dir.plus_file("/godot.cfg"),FileAccess::WRITE); if (!f) { - error->set_text(TTR("Couldn't create engine.cfg in project path.")); + error->set_text(TTR("Couldn't create godot.cfg in project path.")); } else { f->store_line("; Engine configuration file."); @@ -759,7 +759,7 @@ void ProjectManager::_load_recent_projects() { continue; String project = _name.get_slice("/",1); - String conf=path.plus_file("engine.cfg"); + String conf=path.plus_file("godot.cfg"); bool favorite = (_name.begins_with("favorite_projects/"))?true:false; uint64_t last_modified = 0; @@ -1027,7 +1027,7 @@ void ProjectManager::_scan_dir(DirAccess *da,float pos, float total,List<String> while(n!=String()) { if (da->current_is_dir() && !n.begins_with(".")) { subdirs.push_front(n); - } else if (n=="engine.cfg") { + } else if (n=="godot.cfg") { r_projects->push_back(da->get_current_dir()); } n=da->get_next(); @@ -1151,7 +1151,7 @@ void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) { dir->list_dir_begin(); String file = dir->get_next(); while(confirm && file!=String()) { - if (!dir->current_is_dir() && file.ends_with("engine.cfg")) { + if (!dir->current_is_dir() && file.ends_with("godot.cfg")) { confirm = false; } file = dir->get_next(); diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 764d1e4546..e725786f94 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -1217,7 +1217,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { singleton=this; - set_title(TTR("Project Settings (engine.cfg)")); + set_title(TTR("Project Settings (godot.cfg)")); undo_redo=&p_data->get_undo_redo(); data=p_data; diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index c670245282..3ed101cdd6 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/tools/editor/spatial_editor_gizmos.cpp @@ -2484,7 +2484,7 @@ void GIProbeGizmo::redraw(){ } - add_lines(lines,SpatialEditorGizmos::singleton->reflection_probe_material_internal); + add_lines(lines,SpatialEditorGizmos::singleton->gi_probe_material_internal); Vector<Vector3> handles; @@ -3406,7 +3406,7 @@ SpatialEditorGizmos::SpatialEditorGizmos() { reflection_probe_material = create_line_material(Color(0.5,1.0,0.7)); reflection_probe_material_internal = create_line_material(Color(0.3,0.8,0.5,0.15)); gi_probe_material = create_line_material(Color(0.7,1.0,0.5)); - gi_probe_material_internal = create_line_material(Color(0.5,0.8,0.3,0.4)); + gi_probe_material_internal = create_line_material(Color(0.5,0.8,0.3,0.1)); joint_material = create_line_material(Color(0.6,0.8,1.0)); stream_player_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); diff --git a/tools/scripts/sort-demos.sh b/tools/scripts/sort-demos.sh index d4770b337e..2121d78c15 100644 --- a/tools/scripts/sort-demos.sh +++ b/tools/scripts/sort-demos.sh @@ -1,7 +1,7 @@ #!/bin/bash # When scanning for demos, the project manager sorts them based on their # timestamp, i.e. last modification date. This can make for a pretty -# messy output, so this script 'touches' each engine.cfg file in reverse +# messy output, so this script 'touches' each godot.cfg file in reverse # alphabetical order to ensure a nice listing. # # It's good practice to run it once before packaging demos on the build @@ -17,7 +17,7 @@ if [ -e demos.list ]; then fi for dir in 2d 3d gui misc viewport; do - find "demos/$dir" -name "engine.cfg" |sort >> demos.list + find "demos/$dir" -name "godot.cfg" |sort >> demos.list done cat demos.list |sort -r > demos_r.list diff --git a/tools/translations/ar.po b/tools/translations/ar.po index 0bfef1cfe1..539b94ab62 100644 --- a/tools/translations/ar.po +++ b/tools/translations/ar.po @@ -3252,7 +3252,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5844,11 +5844,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5860,7 +5860,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6094,7 +6094,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/bg.po b/tools/translations/bg.po index 9197a6e702..fe711e1b30 100644 --- a/tools/translations/bg.po +++ b/tools/translations/bg.po @@ -3295,7 +3295,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5890,11 +5890,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5906,7 +5906,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6140,7 +6140,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/bn.po b/tools/translations/bn.po index a3a3a072fc..0b1993caa0 100644 --- a/tools/translations/bn.po +++ b/tools/translations/bn.po @@ -3381,8 +3381,8 @@ msgid "Compress" msgstr "সঙ্কোচন করুন" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "প্রকল্পে সংযুক্ত করুন (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "প্রকল্পে সংযুক্ত করুন (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -5989,12 +5989,12 @@ msgid "Invalid project path, the path must exist!" msgstr "অকার্যকর প্রকল্পের পথ, পথটি অবশ্যই বিদ্যমান হতে হবে!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "অকার্যকর প্রকল্পের পথ, engine.cfg অবশ্যই অনুপস্থিত হতে হবে।" +msgid "Invalid project path, godot.cfg must not exist." +msgstr "অকার্যকর প্রকল্পের পথ, godot.cfg অবশ্যই অনুপস্থিত হতে হবে।" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "অকার্যকর প্রকল্পের পথ, engine.cfg অবশ্যই উপস্থিত হতে হবে।" +msgid "Invalid project path, godot.cfg must exist." +msgstr "অকার্যকর প্রকল্পের পথ, godot.cfg অবশ্যই উপস্থিত হতে হবে।" #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6005,8 +6005,8 @@ msgid "Invalid project path (changed anything?)." msgstr "অকার্যকর প্রকল্পের পথ (কোনোকিছু পরিবর্তন করেছেন?)।" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "প্রকল্পের পথে engine.cfg তৈরি করা সম্ভব হয়নি।" +msgid "Couldn't create godot.cfg in project path." +msgstr "প্রকল্পের পথে godot.cfg তৈরি করা সম্ভব হয়নি।" #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6241,8 +6241,8 @@ msgid "Remove Resource Remap Option" msgstr "রিসোর্সের পুনঃ-নকশার সিদ্ধান্ত অপসারণ করুন" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "প্রকল্পের সেটিংস (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "প্রকল্পের সেটিংস (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/ca.po b/tools/translations/ca.po index 266551ee60..c45cad964b 100644 --- a/tools/translations/ca.po +++ b/tools/translations/ca.po @@ -3406,7 +3406,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -6004,11 +6004,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -6020,7 +6020,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6254,8 +6254,8 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Configuració del Projecte (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Configuració del Projecte (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/cs.po b/tools/translations/cs.po index 4020725d74..3dc52fa536 100644 --- a/tools/translations/cs.po +++ b/tools/translations/cs.po @@ -3321,7 +3321,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5918,11 +5918,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5934,7 +5934,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6168,7 +6168,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/da.po b/tools/translations/da.po index e0d4d9bd98..6148d0b82d 100644 --- a/tools/translations/da.po +++ b/tools/translations/da.po @@ -3323,7 +3323,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5918,11 +5918,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5934,7 +5934,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6168,7 +6168,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/de.po b/tools/translations/de.po index 68ce048b5b..0545ea2f21 100644 --- a/tools/translations/de.po +++ b/tools/translations/de.po @@ -3419,8 +3419,8 @@ msgid "Compress" msgstr "Komprimieren" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Zu Projekt hinzufügen (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Zu Projekt hinzufügen (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -6036,12 +6036,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Ungültiger Projektpfad, der Pfad muss existieren!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Ungültiger Projektpfad, engine.cfg darf nicht existieren." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Ungültiger Projektpfad, godot.cfg darf nicht existieren." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Ungültiger Projektpfad, engine.cfg muss existieren." +msgid "Invalid project path, godot.cfg must exist." +msgstr "Ungültiger Projektpfad, godot.cfg muss existieren." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6052,8 +6052,8 @@ msgid "Invalid project path (changed anything?)." msgstr "Ungültiger Projektpfad (etwas geändert?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "Konnte engine.cfg in Projektpfad nicht erzeugen." +msgid "Couldn't create godot.cfg in project path." +msgstr "Konnte godot.cfg in Projektpfad nicht erzeugen." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6288,8 +6288,8 @@ msgid "Remove Resource Remap Option" msgstr "Ressourcen-Remap-Option entfernen" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Projekteinstellungen (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Projekteinstellungen (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/de_CH.po b/tools/translations/de_CH.po index e6e0efdb23..0420d3fc97 100644 --- a/tools/translations/de_CH.po +++ b/tools/translations/de_CH.po @@ -3295,8 +3295,8 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Zum Projekt hinzufügen (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Zum Projekt hinzufügen (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -5900,12 +5900,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Ungültiger Projektpfad, Pfad existiert nicht!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Ungültiger Projektpfad, engine.cfg vorhanden!" +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Ungültiger Projektpfad, godot.cfg vorhanden!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Ungültiger Projektpfad, engine.cfg nicht vorhanden!" +msgid "Invalid project path, godot.cfg must exist." +msgstr "Ungültiger Projektpfad, godot.cfg nicht vorhanden!" #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -5916,8 +5916,8 @@ msgid "Invalid project path (changed anything?)." msgstr "Ungültiger Projektpfad, (wurde was geändert?)!" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "Die engine.cfg kann im Projektverzeichnis nicht erstellt werden." +msgid "Couldn't create godot.cfg in project path." +msgstr "Die godot.cfg kann im Projektverzeichnis nicht erstellt werden." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6150,7 +6150,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/es.po b/tools/translations/es.po index cec4730148..a1108822fa 100644 --- a/tools/translations/es.po +++ b/tools/translations/es.po @@ -3449,8 +3449,8 @@ msgid "Compress" msgstr "Comprimir" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Añadir al proyecto (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Añadir al proyecto (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -6084,12 +6084,12 @@ msgid "Invalid project path, the path must exist!" msgstr "¡La ruta del proyecto no es correcta, tiene que existir!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "La ruta del proyecto no es correcta, engine.cfg no debe existir." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "La ruta del proyecto no es correcta, godot.cfg no debe existir." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "¡La ruta del proyecto no es correcta, engine.cfg debe existir." +msgid "Invalid project path, godot.cfg must exist." +msgstr "¡La ruta del proyecto no es correcta, godot.cfg debe existir." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6100,8 +6100,8 @@ msgid "Invalid project path (changed anything?)." msgstr "La ruta del proyecto no es correcta (¿has cambiado algo?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "No se pudo crear engine.cfg en la ruta de proyecto." +msgid "Couldn't create godot.cfg in project path." +msgstr "No se pudo crear godot.cfg en la ruta de proyecto." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6338,8 +6338,8 @@ msgid "Remove Resource Remap Option" msgstr "Quitar opción de remapeo de recursos" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Ajustes de proyecto (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Ajustes de proyecto (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/es_AR.po b/tools/translations/es_AR.po index 08376f39c5..d921254859 100644 --- a/tools/translations/es_AR.po +++ b/tools/translations/es_AR.po @@ -3403,8 +3403,8 @@ msgid "Compress" msgstr "Comprimir" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Agregar al Proyecto (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Agregar al Proyecto (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -6019,12 +6019,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Ruta de proyecto inválida, la ruta debe existir!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Ruta de proyecto inválida, engine.cfg no debe existir." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Ruta de proyecto inválida, godot.cfg no debe existir." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Ruta de proyecto inválida, engine.cfg debe existir." +msgid "Invalid project path, godot.cfg must exist." +msgstr "Ruta de proyecto inválida, godot.cfg debe existir." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6035,8 +6035,8 @@ msgid "Invalid project path (changed anything?)." msgstr "Ruta de proyecto inválida (cambiaste algo?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "No se pudo crear engine.cfg en la ruta de proyecto." +msgid "Couldn't create godot.cfg in project path." +msgstr "No se pudo crear godot.cfg en la ruta de proyecto." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6273,8 +6273,8 @@ msgid "Remove Resource Remap Option" msgstr "Remover Opción de Remapeo de Recursos" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Ajustes de Proyecto (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Ajustes de Proyecto (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/fa.po b/tools/translations/fa.po index 8e29cda45f..41a686ba52 100644 --- a/tools/translations/fa.po +++ b/tools/translations/fa.po @@ -3350,7 +3350,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5948,11 +5948,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5964,7 +5964,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6200,7 +6200,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/fr.po b/tools/translations/fr.po index 10f82e2840..2c4f7144fe 100644 --- a/tools/translations/fr.po +++ b/tools/translations/fr.po @@ -3437,8 +3437,8 @@ msgid "Compress" msgstr "Compresser" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Ajouter au projet (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Ajouter au projet (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -6072,12 +6072,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Chemin de projet invalide, le chemin doit exister !" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Chemin de projet invalide, engine.cfg ne doit pas exister." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Chemin de projet invalide, godot.cfg ne doit pas exister." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Chemin de projet invalide, engine.cfg doit exister." +msgid "Invalid project path, godot.cfg must exist." +msgstr "Chemin de projet invalide, godot.cfg doit exister." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6088,9 +6088,9 @@ msgid "Invalid project path (changed anything?)." msgstr "Chemin de projet non valide (avez-vous changé quelque chose ?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" -"Impossible de créer le fichier engine.cfg dans le répertoire du projet." +"Impossible de créer le fichier godot.cfg dans le répertoire du projet." #: tools/editor/project_manager.cpp #, fuzzy @@ -6332,8 +6332,8 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Paramètres du projet (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Paramètres du projet (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/hu.po b/tools/translations/hu.po index ef78f27138..335ab25c6a 100644 --- a/tools/translations/hu.po +++ b/tools/translations/hu.po @@ -3245,7 +3245,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5836,11 +5836,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5852,7 +5852,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6086,7 +6086,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/id.po b/tools/translations/id.po index 917bd21e82..30bd357a21 100644 --- a/tools/translations/id.po +++ b/tools/translations/id.po @@ -3410,7 +3410,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -6006,11 +6006,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -6022,7 +6022,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6256,7 +6256,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/it.po b/tools/translations/it.po index f49c953a7d..8fefe67677 100644 --- a/tools/translations/it.po +++ b/tools/translations/it.po @@ -3416,8 +3416,8 @@ msgid "Compress" msgstr "Comprimi" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Aggiungi a Progetto (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Aggiungi a Progetto (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -6031,12 +6031,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Percorso di progetto invalido, il percorso deve esistere!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Percorso di progetto invalido, engine.cfg non deve esistere." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Percorso di progetto invalido, godot.cfg non deve esistere." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Percorso di progetto invalido, engine.cfg deve esistere." +msgid "Invalid project path, godot.cfg must exist." +msgstr "Percorso di progetto invalido, godot.cfg deve esistere." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6047,8 +6047,8 @@ msgid "Invalid project path (changed anything?)." msgstr "Percorso di progetto invalido (cambiato qualcosa?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "Impossibile creare engine.cfg nel percorso di progetto." +msgid "Couldn't create godot.cfg in project path." +msgstr "Impossibile creare godot.cfg nel percorso di progetto." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6283,8 +6283,8 @@ msgid "Remove Resource Remap Option" msgstr "Rimuovi Opzione di Remap Rimorse" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Impostazioni Progetto (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Impostazioni Progetto (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/ja.po b/tools/translations/ja.po index 279f59c9c8..ea314db101 100644 --- a/tools/translations/ja.po +++ b/tools/translations/ja.po @@ -3347,7 +3347,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5945,11 +5945,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5961,7 +5961,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6195,7 +6195,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/ko.po b/tools/translations/ko.po index ea2b130d37..a0ecb70bf5 100644 --- a/tools/translations/ko.po +++ b/tools/translations/ko.po @@ -3350,8 +3350,8 @@ msgid "Compress" msgstr "압축" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "프로젝트에 추가 (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "프로젝트에 추가 (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -5954,12 +5954,12 @@ msgid "Invalid project path, the path must exist!" msgstr "프로젝트 경로가 유효하지 않습니다. 경로가 반드시 존재해야 합니다!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "프로젝트 경로가 유효하지 않습니다. engine.cfg가 있으면 안됩니다." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "프로젝트 경로가 유효하지 않습니다. godot.cfg가 있으면 안됩니다." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "프로젝트 경로가 유효하지 않습니다. engine.cfg가 존재해야합니다." +msgid "Invalid project path, godot.cfg must exist." +msgstr "프로젝트 경로가 유효하지 않습니다. godot.cfg가 존재해야합니다." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -5970,8 +5970,8 @@ msgid "Invalid project path (changed anything?)." msgstr "유효하지 않은 프로젝트 경로 (뭔가 변경하신 거라도?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "프로젝트 경로에 engine.cfg를 생성할 수 없습니다." +msgid "Couldn't create godot.cfg in project path." +msgstr "프로젝트 경로에 godot.cfg를 생성할 수 없습니다." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6205,8 +6205,8 @@ msgid "Remove Resource Remap Option" msgstr "리소스 리맵핑 옵션 제거" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "프로젝트 설정 (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "프로젝트 설정 (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/nb.po b/tools/translations/nb.po index ff659eae8b..cbd2a09951 100644 --- a/tools/translations/nb.po +++ b/tools/translations/nb.po @@ -3245,7 +3245,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5836,11 +5836,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5852,7 +5852,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6086,7 +6086,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/pl.po b/tools/translations/pl.po index 465fbe133d..50afecad1b 100644 --- a/tools/translations/pl.po +++ b/tools/translations/pl.po @@ -1601,7 +1601,7 @@ msgstr "" #: tools/editor/dependency_editor.cpp msgid "Remove selected files from the project? (no undo)" -msgstr "Usunąć wybrane pliki z projektu? (Nie można tego cofnąć)" +msgstr "Usunąć wybrane pliki z projektu? (Nie można tego cofnąć)" #: tools/editor/dependency_editor.cpp msgid "Error loading:" @@ -3388,8 +3388,8 @@ msgid "Compress" msgstr "Skompresuj" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Dodaj do projektu (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Dodaj do projektu (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -5995,12 +5995,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Niepoprawna ścieżka projektu, ścieżka musi istnieć!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Niepoprawna ścieżka projektu, engine.cfg nie może istnieć." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Niepoprawna ścieżka projektu, godot.cfg nie może istnieć." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Niepoprawna ścieżka projektu, engine.cfg musi istnieć." +msgid "Invalid project path, godot.cfg must exist." +msgstr "Niepoprawna ścieżka projektu, godot.cfg musi istnieć." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6011,8 +6011,8 @@ msgid "Invalid project path (changed anything?)." msgstr "Niepoprawna ścieżka projektu (zmienić cokolwiek?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "Nie można było utworzyć engine.cfg w ścieżce projektu." +msgid "Couldn't create godot.cfg in project path." +msgstr "Nie można było utworzyć godot.cfg w ścieżce projektu." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6245,8 +6245,8 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Ustawienia projektu (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Ustawienia projektu (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" @@ -6884,7 +6884,7 @@ msgstr "Skróty" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Light Radius" -msgstr "Zmień promień światła" +msgstr "Zmień promień światła" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Camera FOV" @@ -6912,7 +6912,7 @@ msgstr "Zmień wysokośc Capsule Shape" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Ray Shape Length" -msgstr "Zmień długość Ray Shape" +msgstr "Zmień długość Ray Shape" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" diff --git a/tools/translations/pr.po b/tools/translations/pr.po index f8a9505066..8ea2967a22 100644 --- a/tools/translations/pr.po +++ b/tools/translations/pr.po @@ -3263,7 +3263,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5854,11 +5854,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5870,7 +5870,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6104,7 +6104,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/pt_BR.po b/tools/translations/pt_BR.po index 106142b4ea..9ab81786b1 100644 --- a/tools/translations/pt_BR.po +++ b/tools/translations/pt_BR.po @@ -3388,8 +3388,8 @@ msgid "Compress" msgstr "Comprimir" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Adicionar ao Projeto (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Adicionar ao Projeto (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -6012,12 +6012,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Caminho de projeto inválido, o caminho deve existir!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Caminho de projeto inválido, engine.cfg não deve existir." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Caminho de projeto inválido, godot.cfg não deve existir." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Caminho de projeto inválido, engine.cfg deve existir." +msgid "Invalid project path, godot.cfg must exist." +msgstr "Caminho de projeto inválido, godot.cfg deve existir." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6028,8 +6028,8 @@ msgid "Invalid project path (changed anything?)." msgstr "Caminho de projeto inválido (mudou alguma coisa?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "Não se pôde criar engine.cfg no caminho do projeto." +msgid "Couldn't create godot.cfg in project path." +msgstr "Não se pôde criar godot.cfg no caminho do projeto." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6265,8 +6265,8 @@ msgid "Remove Resource Remap Option" msgstr "Remover Opção de Remapeamento de Recurso" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Configurações do Projeto (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Configurações do Projeto (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/pt_PT.po b/tools/translations/pt_PT.po index 7b3c814f8c..da9d971347 100644 --- a/tools/translations/pt_PT.po +++ b/tools/translations/pt_PT.po @@ -3258,7 +3258,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5850,11 +5850,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5866,7 +5866,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6100,7 +6100,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/ru.po b/tools/translations/ru.po index 73262dbd5e..0595a675b3 100644 --- a/tools/translations/ru.po +++ b/tools/translations/ru.po @@ -3391,8 +3391,8 @@ msgid "Compress" msgstr "Сжимать" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Добавить в проект (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Добавить в проект (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -6004,12 +6004,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Неверный путь к проекту, путь должен существовать!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Недопустимый путь к проекту, engine.cfg не должен существовать." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Недопустимый путь к проекту, godot.cfg не должен существовать." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Недопустимый путь к проекту, engine.cfg должен существовать." +msgid "Invalid project path, godot.cfg must exist." +msgstr "Недопустимый путь к проекту, godot.cfg должен существовать." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6020,8 +6020,8 @@ msgid "Invalid project path (changed anything?)." msgstr "Неверный путь к проекту (Что-то изменили?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "Не могу создать engine.cfg в папке проекта." +msgid "Couldn't create godot.cfg in project path." +msgstr "Не могу создать godot.cfg в папке проекта." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6256,8 +6256,8 @@ msgid "Remove Resource Remap Option" msgstr "Удалён параметр ресурса перенаправления" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Настройки проекта (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Настройки проекта (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/sk.po b/tools/translations/sk.po index f1bd9f1300..6aa2e16664 100644 --- a/tools/translations/sk.po +++ b/tools/translations/sk.po @@ -3261,7 +3261,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5857,11 +5857,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5873,7 +5873,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6107,7 +6107,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/sl.po b/tools/translations/sl.po index 12903cba83..4934be97d7 100644 --- a/tools/translations/sl.po +++ b/tools/translations/sl.po @@ -3270,7 +3270,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5862,11 +5862,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5878,7 +5878,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6112,7 +6112,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/tools.pot b/tools/translations/tools.pot index 447067beb3..8e54d88989 100644 --- a/tools/translations/tools.pot +++ b/tools/translations/tools.pot @@ -3239,7 +3239,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5830,11 +5830,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5846,7 +5846,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6080,7 +6080,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/tr.po b/tools/translations/tr.po index b930e302f2..5c0b6ebca8 100644 --- a/tools/translations/tr.po +++ b/tools/translations/tr.po @@ -3382,8 +3382,8 @@ msgid "Compress" msgstr "Sıkıştır" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "Tasarıya Ekle (engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "Tasarıya Ekle (godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -5994,12 +5994,12 @@ msgid "Invalid project path, the path must exist!" msgstr "Geçersiz tasarı yolu, yolun var olması gerekir!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." -msgstr "Geçersiz tasarı yolu, engine.cfg var olmaması gerekir." +msgid "Invalid project path, godot.cfg must not exist." +msgstr "Geçersiz tasarı yolu, godot.cfg var olmaması gerekir." #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." -msgstr "Geçersiz tasarı yolu, engine.cfg var olması gerekir." +msgid "Invalid project path, godot.cfg must exist." +msgstr "Geçersiz tasarı yolu, godot.cfg var olması gerekir." #: tools/editor/project_manager.cpp msgid "Imported Project" @@ -6010,8 +6010,8 @@ msgid "Invalid project path (changed anything?)." msgstr "Geçersiz tasarı yolu (bir şey değişti mi?)." #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "engine.cfg tasarı yolunda oluşturulamadı." +msgid "Couldn't create godot.cfg in project path." +msgstr "godot.cfg tasarı yolunda oluşturulamadı." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6247,8 +6247,8 @@ msgid "Remove Resource Remap Option" msgstr "Kaynak Yeniden Eşle Seçeneğini Kaldır" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "Tasarı Ayarları (engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "Tasarı Ayarları (godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/ur_PK.po b/tools/translations/ur_PK.po index 0eed08b52a..b898301d0c 100644 --- a/tools/translations/ur_PK.po +++ b/tools/translations/ur_PK.po @@ -3255,7 +3255,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5850,11 +5850,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5866,7 +5866,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6100,7 +6100,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/zh_CN.po b/tools/translations/zh_CN.po index 58f79fac56..47c77f6170 100644 --- a/tools/translations/zh_CN.po +++ b/tools/translations/zh_CN.po @@ -3312,8 +3312,8 @@ msgid "Compress" msgstr "压缩" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" -msgstr "添加到项目(engine.cfg)" +msgid "Add to Project (godot.cfg)" +msgstr "添加到项目(godot.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" @@ -5912,11 +5912,11 @@ msgid "Invalid project path, the path must exist!" msgstr "项目目录不存在!" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "项目目录下必须包含engin.cfg文件。" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "项目目录下必须包含engin.cfg文件。" #: tools/editor/project_manager.cpp @@ -5928,8 +5928,8 @@ msgid "Invalid project path (changed anything?)." msgstr "项目路径非法(被外部修改?)。" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." -msgstr "无法在项目目录下创建engine.cfg文件。" +msgid "Couldn't create godot.cfg in project path." +msgstr "无法在项目目录下创建godot.cfg文件。" #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" @@ -6162,8 +6162,8 @@ msgid "Remove Resource Remap Option" msgstr "移除资源重定向选项" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" -msgstr "项目设置(engine.cfg)" +msgid "Project Settings (godot.cfg)" +msgstr "项目设置(godot.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" diff --git a/tools/translations/zh_HK.po b/tools/translations/zh_HK.po index 60f2b51464..b0bb11d527 100644 --- a/tools/translations/zh_HK.po +++ b/tools/translations/zh_HK.po @@ -3272,7 +3272,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5872,11 +5872,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5888,7 +5888,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6122,7 +6122,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp diff --git a/tools/translations/zh_TW.po b/tools/translations/zh_TW.po index efad7ee167..3e9b61ec0f 100644 --- a/tools/translations/zh_TW.po +++ b/tools/translations/zh_TW.po @@ -3259,7 +3259,7 @@ msgid "Compress" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp -msgid "Add to Project (engine.cfg)" +msgid "Add to Project (godot.cfg)" msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5850,11 +5850,11 @@ msgid "Invalid project path, the path must exist!" msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must not exist." +msgid "Invalid project path, godot.cfg must not exist." msgstr "" #: tools/editor/project_manager.cpp -msgid "Invalid project path, engine.cfg must exist." +msgid "Invalid project path, godot.cfg must exist." msgstr "" #: tools/editor/project_manager.cpp @@ -5866,7 +5866,7 @@ msgid "Invalid project path (changed anything?)." msgstr "" #: tools/editor/project_manager.cpp -msgid "Couldn't create engine.cfg in project path." +msgid "Couldn't create godot.cfg in project path." msgstr "" #: tools/editor/project_manager.cpp @@ -6100,7 +6100,7 @@ msgid "Remove Resource Remap Option" msgstr "" #: tools/editor/project_settings.cpp -msgid "Project Settings (engine.cfg)" +msgid "Project Settings (godot.cfg)" msgstr "" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp |