diff options
author | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
commit | 7246c387435769a169ac24c91434c615df6434b4 (patch) | |
tree | 61842e3e0ce85e80720fdd7476d44d2e629f59fd /source/blender/io/wavefront_obj/importer/obj_import_mtl.cc | |
parent | c5f55d17096d373791363e46004176e3f7f7ae52 (diff) | |
parent | 0b4bd3ddc016298e868169a541cf6c132b10c587 (diff) |
Merge branch 'master' into asset-browser-grid-viewasset-browser-grid-view
Diffstat (limited to 'source/blender/io/wavefront_obj/importer/obj_import_mtl.cc')
-rw-r--r-- | source/blender/io/wavefront_obj/importer/obj_import_mtl.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc index c471b2002de..787b1fc9730 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc @@ -123,7 +123,7 @@ static Image *load_texture_image(Main *bmain, const MTLTexMap &tex_map, bool rel /* Try replacing underscores with spaces. */ std::string no_underscore_path{no_quote_path}; std::replace(no_underscore_path.begin(), no_underscore_path.end(), '_', ' '); - if (no_underscore_path != no_quote_path && no_underscore_path != tex_path) { + if (!ELEM(no_underscore_path, no_quote_path, tex_path)) { image = load_image_at_path(bmain, no_underscore_path, relative_paths); if (image != nullptr) { return image; @@ -356,7 +356,7 @@ static void add_image_textures(Main *bmain, bool relative_paths) { float node_locy = node_locy_top; - for (int key = 0; key < (int)MTLTexMapType::Count; ++key) { + for (int key = 0; key < int(MTLTexMapType::Count); ++key) { const MTLTexMap &value = mtl_mat.texture_maps[key]; if (!value.is_valid()) { /* No Image texture node of this map type can be added to this material. */ @@ -375,7 +375,7 @@ static void add_image_textures(Main *bmain, /* Add normal map node if needed. */ bNode *normal_map = nullptr; - if (key == (int)MTLTexMapType::Normal) { + if (key == int(MTLTexMapType::Normal)) { normal_map = add_node(ntree, SH_NODE_NORMAL_MAP, node_locx_normalmap, node_locy); const float bump = std::max(0.0f, mtl_mat.normal_strength); set_property_of_socket(SOCK_FLOAT, "Strength", {bump}, normal_map); @@ -396,7 +396,7 @@ static void add_image_textures(Main *bmain, link_sockets(ntree, image_node, "Color", normal_map, "Color"); link_sockets(ntree, normal_map, "Normal", bsdf, "Normal"); } - else if (key == (int)MTLTexMapType::Alpha) { + else if (key == int(MTLTexMapType::Alpha)) { link_sockets(ntree, image_node, "Alpha", bsdf, tex_map_type_to_socket_id[key]); mat->blend_method = MA_BM_BLEND; } |