[Bf-blender-cvs] [bddcb89cdaa] master: OBJ: always set eevee blend mode when material "d" is below 1.0
Aras Pranckevicius
noreply at git.blender.org
Thu Jul 7 10:35:06 CEST 2022
Commit: bddcb89cdaa6d9b36b3e42547a95bff792d37610
Author: Aras Pranckevicius
Date: Thu Jul 7 11:32:56 2022 +0300
Branches: master
https://developer.blender.org/rBbddcb89cdaa6d9b36b3e42547a95bff792d37610
OBJ: always set eevee blend mode when material "d" is below 1.0
Fixes T97743: the import code was setting EEVEE blending mode whenever
a transparency texture was present (map_d), or when the materials
illum was saying "yo, transparency!". But if only the material's d
was below 1.0, it was not setting the blend mode, which is different
to user expectations.
Differential Revision: https://developer.blender.org/D15383
===================================================================
M source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
===================================================================
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 f39def0a4af..60e419728f3 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
@@ -320,7 +320,7 @@ void ShaderNodetreeWrap::set_bsdf_socket_values(Material *mat)
if (alpha != -1) {
set_property_of_socket(SOCK_FLOAT, "Alpha", {alpha}, bsdf_);
}
- if (do_tranparency) {
+ if (do_tranparency || (alpha >= 0.0f && alpha < 1.0f)) {
mat->blend_method = MA_BM_BLEND;
}
}
More information about the Bf-blender-cvs
mailing list