From 7833c79d7d8c0741f7f3a99c7af24654a2d2f811 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 16 Oct 2021 15:51:11 +0300 Subject: [PATCH] Add blend statement also with custom shaders --- blender/io_mspgl/export_material.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/blender/io_mspgl/export_material.py b/blender/io_mspgl/export_material.py index 617a683f..6a194dfb 100644 --- a/blender/io_mspgl/export_material.py +++ b/blender/io_mspgl/export_material.py @@ -6,12 +6,19 @@ def create_technique_resource(material, resources): mat_res = resources[material.name+".mat"] + blend_st = None + if material.blended: + blend_st = Statement("blend", Token("SRC_ALPHA"), Token("ONE_MINUS_SRC_ALPHA")) + if material.render_mode=='CUSTOM': for m in material.render_methods: st = Statement("method", m.tag) if mat_res and m.use_material: st.sub.append(tech_res.create_reference_statement("material", mat_res)) + if m.tag=="blended" and blend_st: + st.sub.append(blend_st) + shader = m.shader if shader.endswith(".glsl"): shader += ".shader" @@ -30,8 +37,8 @@ def create_technique_resource(material, resources): if mat_res: st.sub.append(tech_res.create_embed_statement("material", mat_res)) - if material.blended: - ss.sub.append(Statement("blend", Token("SRC_ALPHA"), Token("ONE_MINUS_SRC_ALPHA"))) + if blend_st: + st.sub.append(blend_st) if material.receive_shadows: st.sub.append(Statement("receive_shadows", True)) if material.image_based_lighting: -- 2.45.2