Merge pull request #29815 from NilsIrl/plus_file_1
Replace ` + "/" + ` with `String::file_add()`
This commit is contained in:
commit
d17eac735c
17 changed files with 39 additions and 39 deletions
|
@ -378,7 +378,7 @@ Error DirAccess::_copy_dir(DirAccess *p_target_da, String p_to, int p_chmod_flag
|
||||||
list_dir_end();
|
list_dir_end();
|
||||||
return ERR_BUG;
|
return ERR_BUG;
|
||||||
}
|
}
|
||||||
Error err = copy(get_current_dir() + "/" + n, p_to + rel_path, p_chmod_flags);
|
Error err = copy(get_current_dir().plus_file(n), p_to + rel_path, p_chmod_flags);
|
||||||
if (err) {
|
if (err) {
|
||||||
list_dir_end();
|
list_dir_end();
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -313,7 +313,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
|
||||||
// try_dir is the directory we are trying to change into
|
// try_dir is the directory we are trying to change into
|
||||||
String try_dir = "";
|
String try_dir = "";
|
||||||
if (p_dir.is_rel_path()) {
|
if (p_dir.is_rel_path()) {
|
||||||
String next_dir = current_dir + "/" + p_dir;
|
String next_dir = current_dir.plus_file(p_dir);
|
||||||
next_dir = next_dir.simplify_path();
|
next_dir = next_dir.simplify_path();
|
||||||
try_dir = next_dir;
|
try_dir = next_dir;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -308,7 +308,7 @@ void Collada::_parse_image(XMLParser &parser) {
|
||||||
String path = parser.get_attribute_value("source").strip_edges();
|
String path = parser.get_attribute_value("source").strip_edges();
|
||||||
if (path.find("://") == -1 && path.is_rel_path()) {
|
if (path.find("://") == -1 && path.is_rel_path()) {
|
||||||
// path is relative to file being loaded, so convert to a resource path
|
// path is relative to file being loaded, so convert to a resource path
|
||||||
image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir() + "/" + path.percent_decode());
|
image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().plus_file(path.percent_decode()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ void Collada::_parse_image(XMLParser &parser) {
|
||||||
|
|
||||||
if (path.find("://") == -1 && path.is_rel_path()) {
|
if (path.find("://") == -1 && path.is_rel_path()) {
|
||||||
// path is relative to file being loaded, so convert to a resource path
|
// path is relative to file being loaded, so convert to a resource path
|
||||||
path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir() + "/" + path);
|
path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().plus_file(path));
|
||||||
|
|
||||||
} else if (path.find("file:///") == 0) {
|
} else if (path.find("file:///") == 0) {
|
||||||
path = path.replace_first("file:///", "");
|
path = path.replace_first("file:///", "");
|
||||||
|
|
|
@ -96,7 +96,7 @@ String EditorFileSystemDirectory::get_path() const {
|
||||||
String p;
|
String p;
|
||||||
const EditorFileSystemDirectory *d = this;
|
const EditorFileSystemDirectory *d = this;
|
||||||
while (d->parent) {
|
while (d->parent) {
|
||||||
p = d->name + "/" + p;
|
p = d->name.plus_file(p);
|
||||||
d = d->parent;
|
d = d->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ String EditorFileSystemDirectory::get_file_path(int p_idx) const {
|
||||||
String file = get_file(p_idx);
|
String file = get_file(p_idx);
|
||||||
const EditorFileSystemDirectory *d = this;
|
const EditorFileSystemDirectory *d = this;
|
||||||
while (d->parent) {
|
while (d->parent) {
|
||||||
file = d->name + "/" + file;
|
file = d->name.plus_file(file);
|
||||||
d = d->parent;
|
d = d->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1334,7 +1334,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
|
||||||
end = bbcode.length();
|
end = bbcode.length();
|
||||||
String image = bbcode.substr(brk_end + 1, end - brk_end - 1);
|
String image = bbcode.substr(brk_end + 1, end - brk_end - 1);
|
||||||
|
|
||||||
Ref<Texture> texture = ResourceLoader::load(base_path + "/" + image, "Texture");
|
Ref<Texture> texture = ResourceLoader::load(base_path.plus_file(image), "Texture");
|
||||||
if (texture.is_valid())
|
if (texture.is_valid())
|
||||||
p_rt->add_image(texture);
|
p_rt->add_image(texture);
|
||||||
|
|
||||||
|
@ -1390,7 +1390,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
|
||||||
|
|
||||||
String fnt = tag.substr(5, tag.length());
|
String fnt = tag.substr(5, tag.length());
|
||||||
|
|
||||||
Ref<Font> font = ResourceLoader::load(base_path + "/" + fnt, "Font");
|
Ref<Font> font = ResourceLoader::load(base_path.plus_file(fnt), "Font");
|
||||||
if (font.is_valid())
|
if (font.is_valid())
|
||||||
p_rt->push_font(font);
|
p_rt->push_font(font);
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -2818,7 +2818,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled,
|
||||||
|
|
||||||
Ref<ConfigFile> cf;
|
Ref<ConfigFile> cf;
|
||||||
cf.instance();
|
cf.instance();
|
||||||
String addon_path = "res://addons/" + p_addon + "/plugin.cfg";
|
String addon_path = String("res://addons").plus_file(p_addon).plus_file("plugin.cfg");
|
||||||
if (!DirAccess::exists(addon_path.get_base_dir())) {
|
if (!DirAccess::exists(addon_path.get_base_dir())) {
|
||||||
ProjectSettings *ps = ProjectSettings::get_singleton();
|
ProjectSettings *ps = ProjectSettings::get_singleton();
|
||||||
PoolStringArray enabled_plugins = ps->get("editor_plugins/enabled");
|
PoolStringArray enabled_plugins = ps->get("editor_plugins/enabled");
|
||||||
|
@ -2845,7 +2845,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled,
|
||||||
}
|
}
|
||||||
|
|
||||||
String path = cf->get_value("plugin", "script");
|
String path = cf->get_value("plugin", "script");
|
||||||
path = "res://addons/" + p_addon + "/" + path;
|
path = String("res://addons").plus_file(p_addon).plus_file(path);
|
||||||
|
|
||||||
Ref<Script> script = ResourceLoader::load(path);
|
Ref<Script> script = ResourceLoader::load(path);
|
||||||
|
|
||||||
|
|
|
@ -938,7 +938,7 @@ fail:
|
||||||
Vector<String> list = extra_config->get_value("init_projects", "list");
|
Vector<String> list = extra_config->get_value("init_projects", "list");
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
|
||||||
list.write[i] = exe_path + "/" + list[i];
|
list.write[i] = exe_path.plus_file(list[i]);
|
||||||
};
|
};
|
||||||
extra_config->set_value("init_projects", "list", list);
|
extra_config->set_value("init_projects", "list", list);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1329,7 +1329,7 @@ void FileSystemDock::_duplicate_operation_confirm() {
|
||||||
if (to_duplicate.is_file) {
|
if (to_duplicate.is_file) {
|
||||||
new_path = base_dir.plus_file(new_name);
|
new_path = base_dir.plus_file(new_name);
|
||||||
} else {
|
} else {
|
||||||
new_path = base_dir.substr(0, base_dir.find_last("/")) + "/" + new_name;
|
new_path = base_dir.substr(0, base_dir.find_last("/")).plus_file(new_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Present a more user friendly warning for name conflict
|
//Present a more user friendly warning for name conflict
|
||||||
|
|
|
@ -59,7 +59,7 @@ void GroupDialog::_group_selected() {
|
||||||
void GroupDialog::_load_nodes(Node *p_current) {
|
void GroupDialog::_load_nodes(Node *p_current) {
|
||||||
String item_name = p_current->get_name();
|
String item_name = p_current->get_name();
|
||||||
if (p_current != scene_tree->get_edited_scene_root()) {
|
if (p_current != scene_tree->get_edited_scene_root()) {
|
||||||
item_name = String(p_current->get_parent()->get_name()) + "/" + String(item_name);
|
item_name = String(p_current->get_parent()->get_name()) + "/" + item_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool keep = true;
|
bool keep = true;
|
||||||
|
|
|
@ -574,8 +574,8 @@ void ScriptTextEditor::_validate_script() {
|
||||||
Connection connection = E->get();
|
Connection connection = E->get();
|
||||||
|
|
||||||
String base_path = base->get_name();
|
String base_path = base->get_name();
|
||||||
String source_path = base == connection.source ? base_path : base_path + "/" + String(base->get_path_to(Object::cast_to<Node>(connection.source)));
|
String source_path = base == connection.source ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.source));
|
||||||
String target_path = base == connection.target ? base_path : base_path + "/" + String(base->get_path_to(Object::cast_to<Node>(connection.target)));
|
String target_path = base == connection.target ? base_path : base_path + "/" + base->get_path_to(Object::cast_to<Node>(connection.target));
|
||||||
|
|
||||||
warnings_panel->push_cell();
|
warnings_panel->push_cell();
|
||||||
warnings_panel->push_color(warnings_panel->get_color("warning_color", "Editor"));
|
warnings_panel->push_color(warnings_panel->get_color("warning_color", "Editor"));
|
||||||
|
|
|
@ -1709,13 +1709,13 @@ bool Main::start() {
|
||||||
|
|
||||||
if (sep == -1) {
|
if (sep == -1) {
|
||||||
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
||||||
local_game_path = da->get_current_dir() + "/" + local_game_path;
|
local_game_path = da->get_current_dir().plus_file(local_game_path);
|
||||||
memdelete(da);
|
memdelete(da);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
DirAccess *da = DirAccess::open(local_game_path.substr(0, sep));
|
DirAccess *da = DirAccess::open(local_game_path.substr(0, sep));
|
||||||
if (da) {
|
if (da) {
|
||||||
local_game_path = da->get_current_dir() + "/" + local_game_path.substr(sep + 1, local_game_path.length());
|
local_game_path = da->get_current_dir().plus_file(local_game_path.substr(sep + 1, local_game_path.length()));
|
||||||
memdelete(da);
|
memdelete(da);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -848,7 +848,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
|
|
||||||
if (AI_SUCCESS == ai_material->GetTexture(tex_normal, 0, &ai_filename, NULL, NULL, NULL, NULL, map_mode)) {
|
if (AI_SUCCESS == ai_material->GetTexture(tex_normal, 0, &ai_filename, NULL, NULL, NULL, NULL, map_mode)) {
|
||||||
filename = _assimp_raw_string_to_string(ai_filename);
|
filename = _assimp_raw_string_to_string(ai_filename);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -869,7 +869,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
|
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_NORMAL_TEXTURE, ai_filename)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_NORMAL_TEXTURE, ai_filename)) {
|
||||||
filename = _assimp_raw_string_to_string(ai_filename);
|
filename = _assimp_raw_string_to_string(ai_filename);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -892,7 +892,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
|
|
||||||
if (AI_SUCCESS == ai_material->GetTexture(tex_emissive, 0, &ai_filename, NULL, NULL, NULL, NULL, map_mode)) {
|
if (AI_SUCCESS == ai_material->GetTexture(tex_emissive, 0, &ai_filename, NULL, NULL, NULL, NULL, map_mode)) {
|
||||||
filename = _assimp_raw_string_to_string(ai_filename);
|
filename = _assimp_raw_string_to_string(ai_filename);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -914,7 +914,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiTextureMapMode map_mode[2];
|
aiTextureMapMode map_mode[2];
|
||||||
if (AI_SUCCESS == ai_material->GetTexture(tex_albedo, 0, &ai_filename, NULL, NULL, NULL, NULL, map_mode)) {
|
if (AI_SUCCESS == ai_material->GetTexture(tex_albedo, 0, &ai_filename, NULL, NULL, NULL, NULL, map_mode)) {
|
||||||
filename = _assimp_raw_string_to_string(ai_filename);
|
filename = _assimp_raw_string_to_string(ai_filename);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -944,7 +944,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiTextureMapMode map_mode[2];
|
aiTextureMapMode map_mode[2];
|
||||||
if (AI_SUCCESS == ai_material->GetTexture(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_TEXTURE, &tex_gltf_base_color_path, NULL, NULL, NULL, NULL, map_mode)) {
|
if (AI_SUCCESS == ai_material->GetTexture(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_TEXTURE, &tex_gltf_base_color_path, NULL, NULL, NULL, NULL, map_mode)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_gltf_base_color_path);
|
String filename = _assimp_raw_string_to_string(tex_gltf_base_color_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -973,7 +973,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_pbs_base_color_path = aiString();
|
aiString tex_fbx_pbs_base_color_path = aiString();
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_BASE_COLOR_TEXTURE, tex_fbx_pbs_base_color_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_BASE_COLOR_TEXTURE, tex_fbx_pbs_base_color_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_base_color_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_base_color_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1005,7 +1005,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_pbs_normal_path = aiString();
|
aiString tex_fbx_pbs_normal_path = aiString();
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_NORMAL_TEXTURE, tex_fbx_pbs_normal_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_NORMAL_TEXTURE, tex_fbx_pbs_normal_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_normal_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_normal_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1027,7 +1027,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_stingray_normal_path = aiString();
|
aiString tex_fbx_stingray_normal_path = aiString();
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_NORMAL_TEXTURE, tex_fbx_stingray_normal_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_NORMAL_TEXTURE, tex_fbx_stingray_normal_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_stingray_normal_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_stingray_normal_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1045,7 +1045,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_pbs_base_color_path = aiString();
|
aiString tex_fbx_pbs_base_color_path = aiString();
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_COLOR_TEXTURE, tex_fbx_pbs_base_color_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_COLOR_TEXTURE, tex_fbx_pbs_base_color_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_base_color_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_base_color_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1077,7 +1077,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_pbs_emissive_path = aiString();
|
aiString tex_fbx_pbs_emissive_path = aiString();
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_EMISSIVE_TEXTURE, tex_fbx_pbs_emissive_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_EMISSIVE_TEXTURE, tex_fbx_pbs_emissive_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_emissive_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_emissive_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1107,7 +1107,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_gltf_pbr_metallicroughness_path;
|
aiString tex_gltf_pbr_metallicroughness_path;
|
||||||
if (AI_SUCCESS == ai_material->GetTexture(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLICROUGHNESS_TEXTURE, &tex_gltf_pbr_metallicroughness_path)) {
|
if (AI_SUCCESS == ai_material->GetTexture(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLICROUGHNESS_TEXTURE, &tex_gltf_pbr_metallicroughness_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_gltf_pbr_metallicroughness_path);
|
String filename = _assimp_raw_string_to_string(tex_gltf_pbr_metallicroughness_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1134,7 +1134,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_pbs_metallic_path;
|
aiString tex_fbx_pbs_metallic_path;
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_METALLIC_TEXTURE, tex_fbx_pbs_metallic_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_METALLIC_TEXTURE, tex_fbx_pbs_metallic_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_metallic_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_metallic_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1154,7 +1154,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_pbs_rough_path;
|
aiString tex_fbx_pbs_rough_path;
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_ROUGHNESS_TEXTURE, tex_fbx_pbs_rough_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_STINGRAY_ROUGHNESS_TEXTURE, tex_fbx_pbs_rough_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_rough_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_rough_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1177,7 +1177,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_pbs_metallic_path;
|
aiString tex_fbx_pbs_metallic_path;
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_METALNESS_TEXTURE, tex_fbx_pbs_metallic_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_METALNESS_TEXTURE, tex_fbx_pbs_metallic_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_metallic_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_metallic_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1197,7 +1197,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
|
||||||
aiString tex_fbx_pbs_rough_path;
|
aiString tex_fbx_pbs_rough_path;
|
||||||
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_DIFFUSE_ROUGHNESS_TEXTURE, tex_fbx_pbs_rough_path)) {
|
if (AI_SUCCESS == ai_material->Get(AI_MATKEY_FBX_MAYA_DIFFUSE_ROUGHNESS_TEXTURE, tex_fbx_pbs_rough_path)) {
|
||||||
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_rough_path);
|
String filename = _assimp_raw_string_to_string(tex_fbx_pbs_rough_path);
|
||||||
String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
|
String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
|
||||||
bool found = false;
|
bool found = false;
|
||||||
_find_texture_path(state.path, path, found);
|
_find_texture_path(state.path, path, found);
|
||||||
if (found) {
|
if (found) {
|
||||||
|
@ -1684,7 +1684,7 @@ void EditorSceneImporterAssimp::_find_texture_path(const String &p_path, _Direct
|
||||||
path = name;
|
path = name;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String name_ignore_sub_directory = p_path.get_base_dir() + "/" + path.get_file().get_basename() + extension;
|
String name_ignore_sub_directory = p_path.get_base_dir().plus_file(path.get_file().get_basename()) + extension;
|
||||||
if (dir.file_exists(name_ignore_sub_directory)) {
|
if (dir.file_exists(name_ignore_sub_directory)) {
|
||||||
found = true;
|
found = true;
|
||||||
path = name_ignore_sub_directory;
|
path = name_ignore_sub_directory;
|
||||||
|
|
|
@ -463,7 +463,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!path.is_abs_path() && base_path != "")
|
if (!path.is_abs_path() && base_path != "")
|
||||||
path = base_path + "/" + path;
|
path = base_path.plus_file(path);
|
||||||
path = path.replace("///", "//").simplify_path();
|
path = path.replace("///", "//").simplify_path();
|
||||||
if (path == self_path) {
|
if (path == self_path) {
|
||||||
|
|
||||||
|
|
|
@ -594,7 +594,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
|
||||||
if (abi_index != -1) {
|
if (abi_index != -1) {
|
||||||
exported = true;
|
exported = true;
|
||||||
String abi = abis[abi_index];
|
String abi = abis[abi_index];
|
||||||
String dst_path = "lib/" + abi + "/" + p_so.path.get_file();
|
String dst_path = String("lib").plus_file(abi).plus_file(p_so.path.get_file());
|
||||||
Vector<uint8_t> array = FileAccess::get_file_as_array(p_so.path);
|
Vector<uint8_t> array = FileAccess::get_file_as_array(p_so.path);
|
||||||
Error store_err = store_in_apk(ed, dst_path, array);
|
Error store_err = store_in_apk(ed, dst_path, array);
|
||||||
ERR_FAIL_COND_V(store_err, store_err);
|
ERR_FAIL_COND_V(store_err, store_err);
|
||||||
|
|
|
@ -564,7 +564,7 @@ Error EditorExportPlatformIOS::_walk_dir_recursive(DirAccess *p_da, FileHandler
|
||||||
dirs.push_back(path);
|
dirs.push_back(path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Error err = p_handler(current_dir + "/" + path, p_userdata);
|
Error err = p_handler(current_dir.plus_file(path), p_userdata);
|
||||||
if (err) {
|
if (err) {
|
||||||
p_da->list_dir_end();
|
p_da->list_dir_end();
|
||||||
return err;
|
return err;
|
||||||
|
@ -784,7 +784,7 @@ Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String destination = destination_dir + "/" + asset.get_file();
|
String destination = destination_dir.plus_file(asset.get_file());
|
||||||
Error err = dir_exists ? da->copy_dir(asset, destination) : da->copy(asset, destination);
|
Error err = dir_exists ? da->copy_dir(asset, destination) : da->copy(asset, destination);
|
||||||
memdelete(da);
|
memdelete(da);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -570,7 +570,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
||||||
|
|
||||||
if (export_format == "dmg") {
|
if (export_format == "dmg") {
|
||||||
// write it into our application bundle
|
// write it into our application bundle
|
||||||
file = tmp_app_path_name + "/" + file;
|
file = tmp_app_path_name.plus_file(file);
|
||||||
|
|
||||||
// write the file, need to add chmod
|
// write the file, need to add chmod
|
||||||
FileAccess *f = FileAccess::open(file, FileAccess::WRITE);
|
FileAccess *f = FileAccess::open(file, FileAccess::WRITE);
|
||||||
|
|
|
@ -2997,7 +2997,7 @@ void OS_X11::alert(const String &p_alert, const String &p_title) {
|
||||||
|
|
||||||
for (int i = 0; i < path_elems.size(); i++) {
|
for (int i = 0; i < path_elems.size(); i++) {
|
||||||
for (unsigned int k = 0; k < sizeof(message_programs) / sizeof(char *); k++) {
|
for (unsigned int k = 0; k < sizeof(message_programs) / sizeof(char *); k++) {
|
||||||
String tested_path = path_elems[i] + "/" + message_programs[k];
|
String tested_path = path_elems[i].plus_file(message_programs[k]);
|
||||||
|
|
||||||
if (FileAccess::exists(tested_path)) {
|
if (FileAccess::exists(tested_path)) {
|
||||||
program = tested_path;
|
program = tested_path;
|
||||||
|
|
Loading…
Reference in a new issue