summaryrefslogtreecommitdiff
path: root/modules/assimp/editor_scene_importer_assimp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/assimp/editor_scene_importer_assimp.cpp')
-rw-r--r--modules/assimp/editor_scene_importer_assimp.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp
index 8c3c04674b..093e2f3006 100644
--- a/modules/assimp/editor_scene_importer_assimp.cpp
+++ b/modules/assimp/editor_scene_importer_assimp.cpp
@@ -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)) {
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;
_find_texture_path(state.path, path, 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)) {
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;
_find_texture_path(state.path, path, 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)) {
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;
_find_texture_path(state.path, path, found);
if (found) {
@@ -914,7 +914,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
aiTextureMapMode map_mode[2];
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);
- String path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
+ String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
bool found = false;
_find_texture_path(state.path, path, found);
if (found) {
@@ -944,7 +944,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
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)) {
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;
_find_texture_path(state.path, path, found);
if (found) {
@@ -973,7 +973,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
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)) {
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;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1005,7 +1005,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
aiString tex_fbx_pbs_normal_path = aiString();
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 path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
+ String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
bool found = false;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1027,7 +1027,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
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)) {
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;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1045,7 +1045,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
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)) {
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;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1077,7 +1077,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
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)) {
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;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1107,7 +1107,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
aiString 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 path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
+ String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
bool found = false;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1134,7 +1134,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
aiString 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 path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
+ String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
bool found = false;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1154,7 +1154,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
aiString 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 path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
+ String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
bool found = false;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1177,7 +1177,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
aiString 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 path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
+ String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
bool found = false;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1197,7 +1197,7 @@ Ref<Material> EditorSceneImporterAssimp::_generate_material_from_index(ImportSta
aiString 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 path = state.path.get_base_dir() + "/" + filename.replace("\\", "/");
+ String path = state.path.get_base_dir().plus_file(filename.replace("\\", "/"));
bool found = false;
_find_texture_path(state.path, path, found);
if (found) {
@@ -1684,7 +1684,7 @@ void EditorSceneImporterAssimp::_find_texture_path(const String &p_path, _Direct
path = name;
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)) {
found = true;
path = name_ignore_sub_directory;