From 56f6ce69409bd47cee4a58bf5adef1d341505c36 Mon Sep 17 00:00:00 2001 From: William Herald Snyder Date: Mon, 3 Oct 2022 23:06:33 -0400 Subject: [PATCH] Fill doublesidedness and transparency (TODO: figure out additive mapping/emulation) from material settings --- addons/io_scene_swbf_msh/msh_material_operators.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/io_scene_swbf_msh/msh_material_operators.py b/addons/io_scene_swbf_msh/msh_material_operators.py index 851df7b..a4d3257 100644 --- a/addons/io_scene_swbf_msh/msh_material_operators.py +++ b/addons/io_scene_swbf_msh/msh_material_operators.py @@ -39,11 +39,18 @@ class FillSWBFMaterialProperties(bpy.types.Operator): for mat in mats: - if mat.name in mats_visited: + if mat.name in mats_visited or not mat.swbf_msh_mat: continue else: mats_visited.add(mat.name) + mat.swbf_msh_mat.doublesided = not mat.use_backface_culling + mat.swbf_msh_mat.hardedged_transparency = (mat.blend_method == "CLIP") + mat.swbf_msh_mat.blended_transparency = (mat.blend_method == "BLEND") + + + # Below is all for filling the diffuse map/texture_0 fields + try: for BSDF_node in [n for n in mat.node_tree.nodes if n.type == 'BSDF_PRINCIPLED']: base_col = BSDF_node.inputs['Base Color']