Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAras Pranckevicius <aras@nesnausk.org>2022-04-27 22:09:27 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-05-01 20:10:21 +0300
commitc87f6242b952d3821d7bdbdd8075b27479791448 (patch)
tree24085e02fb20acbf5cf08a99f2a8cca1d274f01c /source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
parent33518f9da160cf2d9e91dd7a69cd5788303dcca4 (diff)
Fix T97644: new 3.2 obj importer does not set blend mode for eevee
The old python importer had a "if do_transparency, set blend_method to BLEND" type of logic. This bit was missing in the new importer; it was only setting the eevee blend method when a transparency texture was present, but not in other cases of transparency (as driven by MTL "illum" mode). Reviewd By: Howard Trickey Differential Revision: https://developer.blender.org/D14783
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.cc7
1 files changed, 5 insertions, 2 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 f2a8941e8a7..56e3a062cb6 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
@@ -122,7 +122,7 @@ ShaderNodetreeWrap::ShaderNodetreeWrap(Main *bmain, const MTLMaterial &mtl_mat,
bsdf_ = add_node_to_tree(SH_NODE_BSDF_PRINCIPLED);
shader_output_ = add_node_to_tree(SH_NODE_OUTPUT_MATERIAL);
- set_bsdf_socket_values();
+ set_bsdf_socket_values(mat);
add_image_textures(bmain, mat);
link_sockets(bsdf_, "BSDF", shader_output_, "Surface", 4);
@@ -188,7 +188,7 @@ void ShaderNodetreeWrap::link_sockets(bNode *from_node,
nodeAddLink(nodetree_.get(), from_node, from_sock, to_node, to_sock);
}
-void ShaderNodetreeWrap::set_bsdf_socket_values()
+void ShaderNodetreeWrap::set_bsdf_socket_values(Material *mat)
{
const int illum = mtl_mat_.illum;
bool do_highlight = false;
@@ -309,6 +309,9 @@ void ShaderNodetreeWrap::set_bsdf_socket_values()
set_property_of_socket(SOCK_FLOAT, "Metallic", {metallic}, bsdf_);
set_property_of_socket(SOCK_FLOAT, "IOR", {ior}, bsdf_);
set_property_of_socket(SOCK_FLOAT, "Alpha", {alpha}, bsdf_);
+ if (do_tranparency) {
+ mat->blend_method = MA_BM_BLEND;
+ }
}
void ShaderNodetreeWrap::add_image_textures(Main *bmain, Material *mat)