From b9ba5757a3d139234b5445945b32eae4471724b7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 28 Mar 2021 15:02:23 +0300 Subject: [PATCH] Export texture extension modes from Blender --- blender/io_mspgl/export_texture.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/blender/io_mspgl/export_texture.py b/blender/io_mspgl/export_texture.py index f75d8f93..2ffb5246 100644 --- a/blender/io_mspgl/export_texture.py +++ b/blender/io_mspgl/export_texture.py @@ -64,6 +64,14 @@ class SamplerExporter: else: samp_res.statements.append(Statement("filter", Token('NEAREST'))) + if tex_node.extension=="REPEAT": + samp_res.statements.append(Statement("wrap", Token('REPEAT'))) + elif tex_node.extension=="EXTEND": + samp_res.statements.append(Statement("wrap", Token('CLAMP_TO_EDGE'))) + elif tex_node.extension=="CLIP": + samp_res.statements.append(Statement("wrap", Token('CLAMP_TO_BORDER'))) + samp_res.statements.append(Statement("border_color", 0.0, 0.0, 0.0, 0.0)) + return samp_res def get_sampler_name(self, tex_node): @@ -75,5 +83,7 @@ class SamplerExporter: name_parts.append("mip") if use_interpolation and tex_node.max_anisotropy>1: name_parts.append("aniso{:g}x".format(tex_node.max_anisotropy)) + if tex_node.extension!="REPEAT": + name_parts.append("clip" if tex_node.extension=="CLIP" else "clamp") return "_".join(name_parts)+".samp" -- 2.45.2